Tags in Swift

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Tags in Swift

Terrill Thorne
How can I write a tag in a line of code?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/530f09c1-a4b3-481a-a034-5bcd9a1f4229%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Marco S Hyman

> On Jan 17, 2015, at 9:06 PM, Terrill Thorne <[hidden email]> wrote:
>
> How can I write a tag in a line of code?

Some context, please.   What kind of tag?

HTML tag?
XML tag?
Image metadata tag?
Finder tag?
Graffiti signature?
QR code?
Something else that I'm not thinking of right this second?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/2478AF75-632D-41FF-B1BF-58DEF0B50592%40snafu.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Terrill Thorne
I can't remember which tag it's called but the tag is under "view" in Xcode. 

On Sunday, January 18, 2015 at 12:20:43 AM UTC-5, Marco Hyman wrote:

> On Jan 17, 2015, at 9:06 PM, Terrill Thorne <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="82V18byjx3gJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rm250r...@...> wrote:
>
> How can I write a tag in a line of code?

Some context, please.   What kind of tag?

HTML tag?
XML tag?
Image metadata tag?
Finder tag?
Graffiti signature?
QR code?
Something else that I'm not thinking of right this second?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/43d0d8c3-46dd-43bc-8c51-dda777083c12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Jens Alfke

On Jan 17, 2015, at 9:29 PM, Terrill Thorne <[hidden email]> wrote:

I can't remember which tag it's called but the tag is under "view" in Xcode. 

Well, once you figure out what it is you’re asking for, come back and ask it.

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/3A5B7C4F-E761-4BA1-94C6-0BBFB5C4DAD8%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Ken Ferry
Sounds like the question is about -[UIView tag]. 

It'd be 
  myView.tag = 3

-ken


Sent from Mailbox


On Sat, Jan 17, 2015 at 10:12 PM, Jens Alfke <[hidden email]> wrote:


On Jan 17, 2015, at 9:29 PM, Terrill Thorne <[hidden email]> wrote:

I can't remember which tag it's called but the tag is under "view" in Xcode. 

Well, once you figure out what it is you’re asking for, come back and ask it.

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/3A5B7C4F-E761-4BA1-94C6-0BBFB5C4DAD8%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/1421563419194.219ccffc%40Nodemailer.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Darrell Nicholas
In reply to this post by Terrill Thorne
var imageView.image = UIImage(named:"someImage")
imageView.tag = 1

let myLabel:UILabel = cell.contentView.viewWithTag(5) as UILabel

I think that's the way it's done. (This is all from memory, I could be wrong, but you may have to call view methods on what you want to set the tag value on then cast it using the "at" keyword to whatever it actually is. ex. UILabel, UITextField, UIImageView, and so on.

On Saturday, January 17, 2015 at 11:06:59 PM UTC-6, Terrill Thorne wrote:
How can I write a tag in a line of code?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/213c78ad-ddd0-4ff8-990f-5e0464065ba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Darrell Nicholas
In reply to this post by Jens Alfke
This is the kind of response that causes us in the developer community to have a "stuck up" attitude and ticks me off. I'm sorry, but if you can't tell from the sentence 

"I can't remember which tag it's called but the tag is under "view" in Xcode.", 

what tag they are talking about....then maybe you need to come back when you are more qualified to answer a question. There ain't no Swift experts outside of Apple. NOBODY has used the language for a year yet. So if someone is humble enough to ask a question, then we need to be kind enough to answer it. I doubt you learned everything about programming from reading the Apple Documentation. I'm willing to bet that somewhere, somehow, somebody in the past shared some information with you. If you need more clarification, then ask for clarification. 

I'm self taught, and I learned a lot by hard work. I asked a lot of questions and some people were kind of hateful when I didn't ask the question in the "right" way. The developer community will remain a relatively closed community because of the complexity of programming itself. We don't have to run off people or haze newcomers. Matter of fact, we might need to encourage more people to learn what we know so that we will be compelled to get better ourselves.

You notice how I am being hateful, yet giving you the benefit of the doubt that you know your stuff? You may not know what a tag on a view is or how to set it outside of the Storyboard. If you want, I'll explain it in greater detail. If you ask the right way...

Jens, if you need anymore help, ask here again and I'll look it up and be sure to give you the correct answer. I know how it's done in Objective-C and I believe my other answer is either right or close to right. Don't give up asking. If you get any more rude answers here, go to raywenderlich.com and you WILL find a tutorial about just anything you need to know. Also, skipcasts.com is a great Swift resource. Shinobicontrols.com has a great book you can get for free for signing up for a newsletter. The REAL experts hang out on stackoverflow.com and there are some that are friendly and some not so much. But if someone puts the right answer up, other people will up vote the answer. That's where I turn when I have a question I can't figure out when I'm developing my own custom products.

Never quit in the pursuit. Nobody knows everything about any language.

-Darrell

On Sunday, January 18, 2015 at 12:12:42 AM UTC-6, Jens Alfke wrote:

On Jan 17, 2015, at 9:29 PM, Terrill Thorne <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4YIp5PzTKRwJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rm250r...@...> wrote:

I can't remember which tag it's called but the tag is under "view" in Xcode. 

Well, once you figure out what it is you’re asking for, come back and ask it.

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/cd1aad49-415f-4e03-833c-b542fd8ff642%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Jens Alfke

On Jan 24, 2015, at 3:42 PM, Darrell Nicholas <[hidden email]> wrote:

This is the kind of response that causes us in the developer community to have a "stuck up" attitude and ticks me off. I'm sorry, but if you can't tell from the sentence 

"I can't remember which tag it's called but the tag is under "view" in Xcode.", 

what tag they are talking about....then maybe you need to come back when you are more qualified to answer a question.

No, I couldn't tell, and it had nothing to do with my qualifications; the question itself was hopelessly vague. And what you're quoting wasn't even his original question! He originally asked "How can I write a tag in a line of code?" That was literally the entire message. After someone pointed out that this was too ambiguous to be answerable, he expanded it to what you quoted. Which was still not useful, and also, honestly, lazy. If Terrill "can't remember which tag it's called", then he can go back and look again so that his question has the necessary info. After those two messages I gave up.

So if someone is humble enough to ask a question, then we need to be kind enough to answer it.

Sorry, nope. I don't need a lecture on answering questions — I answer a literal fuckton of questions on Apple's developer mailing lists and on the mailing list for my work project. I've been answering (and asking) questions on mailing lists and Usenet since the '80s. (And it may not be relevant, but I created this Google group, soon after Swift was announced, so that there'd be a good forum for people, including me, to ask questions and discuss it.)

I understand what you mean by "humble", but honestly, some people who ask questions have a very entitled attitude: that the people they're writing to are supposed to solve their problem for them and that they don't need to make it easy to answer. Many times I've gone around and around with someone, coaxing them to give out the necessary context that they could easily have provided up front. (What OS was this? What was the error message you got? What is the actual task you're trying to accomplish? What steps caused this to happen? Does this happen every time? Could you paste the exact code instead of typing something in from memory that obviously doesn't even compile? Etc.) There are even people who are very obviously asking mailing lists to provide complete solutions for their homework problems.

Asking a uselessly vague question is not humble, it's careless and entitled. It shows a lack of respect for the time of the people on the list.

I'm not the only one who gets frustrated. There is a whole genre of online essays about How To Ask Good Questions, written by people who are helpful but frustrated by the exact problems I'm describing. There is the term "help vampire" that describes the very real personality type that demands that other people online solve their problems for them. There is the site lmgtfy.com whose purpose is to shame people who would rather not look for answers themselves.

I doubt you learned everything about programming from reading the Apple Documentation. I'm willing to bet that somewhere, somehow, somebody in the past shared some information with you. If you need more clarification, then ask for clarification. 

Believe me, I ask questions too. I'm always trying to learn new stuff, and when I get stuck I ask for help. And when I do I make sure to get to the point, include all the necessary context, and generally make it as easy as possible for someone to help me, because I am very aware that they are donating that time out of the goodness of their heart.

And I did ask for clarification. I pointed out that the question was too vague and invited him to find out what this "tag" he was looking for was and post a better question. And yes, I did it in a somewhat snarky way, to send a message that what he was doing was inappropriate.

Jens, if you need anymore help, ask here again and I'll look it up and be sure to give you the correct answer. 

Um, the guy asking the question was named Terrill.

—Jens

PS: Sorry this turned into a rant. As you can tell, it's a bit of a sore spot for me, and I usually bite my tongue and just ignore lame questions. I'm also for unrelated reasons having a bad day today and am in a grumpy mood, so you set off the flame-bot. Nothing personal.

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/33B0F728-A3CE-4855-97F7-2467F5E41D37%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Darrell Nicholas
Sorry about getting you mixed up with the asker. I was on a rant too. Yes his question was too vague in the beginning, but from the way the posts were displayed on my screen, he had been asked for clarification and had came back with it. I knew what he was talking about. That's why I quoted it. Yes I know there have been some great articles about the proper way to ask questions, the one that comes to mind is by Ash Furrow. 

But look, there's a TON of new coding bootcamps popping up, tutorial sites everywhere, and the bottom line is there are about to be a lot of people on every forum asking questions the wrong way. When I first started I didn't ask a question for a whole year online because I didn't want to look stupid or have someone smart off to me and make me quit learning. I didn't grow up in an area where there are any universities, much less colleges or high schools, that taught any form of computer science.

I didn't have a CHANCE to learn back in the 80's when I was really wanting to. It wasn't until much later in life that I had the resources, and a good enough job, that I could take the time to start learning on my own. Things are better here nowadays (in rural Arkansas) and maybe people who have the passion to learn can have a better chance at doing so.

I just hope that nobody gets too scared to ask questions and gives up on a dream because they didn't know how to ask in the right way.

I sincerely hope you have a better day. I also want to thank you for taking the time to start this group. Once again, I apologize for getting you mixed up with Terrill. 

I don't know any other way to put it, fucking be nice! It won't kill you. If you don't want me in your group, I won't visit again. I will always say what I think and feel. Life's too short and I'm too old to hold back now.

That's all I got to say on the subject.

On Sunday, January 25, 2015 at 4:26:07 PM UTC-6, Jens Alfke wrote:

On Jan 24, 2015, at 3:42 PM, Darrell Nicholas <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Nq1gtEN6pGsJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">darrellw...@...> wrote:

This is the kind of response that causes us in the developer community to have a "stuck up" attitude and ticks me off. I'm sorry, but if you can't tell from the sentence 

"I can't remember which tag it's called but the tag is under "view" in Xcode.", 

what tag they are talking about....then maybe you need to come back when you are more qualified to answer a question.

No, I couldn't tell, and it had nothing to do with my qualifications; the question itself was hopelessly vague. And what you're quoting wasn't even his original question! He originally asked "How can I write a tag in a line of code?" That was <a href="https://groups.google.com/d/msg/swift-language/bqbWzNLfcHI/SV66Dpb74sgJ" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/msg/swift-language/bqbWzNLfcHI/SV66Dpb74sgJ';return true;" onclick="this.href='https://groups.google.com/d/msg/swift-language/bqbWzNLfcHI/SV66Dpb74sgJ';return true;">literally the entire message. After someone pointed out that this was too ambiguous to be answerable, he expanded it to what you quoted. Which was still not useful, and also, honestly, lazy. If Terrill "can't remember which tag it's called", then he can go back and look again so that his question has the necessary info. After those two messages I gave up.

So if someone is humble enough to ask a question, then we need to be kind enough to answer it.

Sorry, nope. I don't need a lecture on answering questions — I answer a <a href="https://www.google.com/#q=site:lists.apple.com+%22jens+alfke%22" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/#q\75site:lists.apple.com+%22jens+alfke%22';return true;" onclick="this.href='https://www.google.com/#q\75site:lists.apple.com+%22jens+alfke%22';return true;">literal fuckton of questions on Apple's developer mailing lists and on the <a href="https://groups.google.com/forum/?fromgroups#!searchin/mobile-couchbase/jens" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/forum/?fromgroups#!searchin/mobile-couchbase/jens';return true;" onclick="this.href='https://groups.google.com/forum/?fromgroups#!searchin/mobile-couchbase/jens';return true;">mailing list for my work project. I've been answering (and asking) questions on mailing lists and Usenet since the '80s. (And it may not be relevant, but I created this Google group, soon after Swift was announced, so that there'd be a good forum for people, including me, to ask questions and discuss it.)

I understand what you mean by "humble", but honestly, some people who ask questions have a very entitled attitude: that the people they're writing to are supposed to solve their problem for them and that they don't need to make it easy to answer. Many times I've gone around and around with someone, coaxing them to give out the necessary context that they could easily have provided up front. (What OS was this? What was the error message you got? What is the actual task you're trying to accomplish? What steps caused this to happen? Does this happen every time? Could you paste the exact code instead of typing something in from memory that obviously doesn't even compile? Etc.) There are even people who are very obviously asking mailing lists to provide complete solutions for their homework problems.

Asking a uselessly vague question is not humble, it's careless and entitled. It shows a lack of respect for the time of the people on the list.

I'm not the only one who gets frustrated. There is a whole genre of online essays about <a href="http://www.gerv.net/hacking/how-to-ask-good-questions/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.gerv.net%2Fhacking%2Fhow-to-ask-good-questions%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcs1Xw01Oos28Q3QRuwlRmPmEgJQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.gerv.net%2Fhacking%2Fhow-to-ask-good-questions%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcs1Xw01Oos28Q3QRuwlRmPmEgJQ';return true;">How To Ask Good Questions, written by people who are helpful but frustrated by the exact problems I'm describing. There is the term "<a href="http://meta.stackoverflow.com/questions/258206/what-is-a-help-vampire" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmeta.stackoverflow.com%2Fquestions%2F258206%2Fwhat-is-a-help-vampire\46sa\75D\46sntz\0751\46usg\75AFQjCNHyeFH4FptPFG4Qiz8nLuAsDGLO-A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmeta.stackoverflow.com%2Fquestions%2F258206%2Fwhat-is-a-help-vampire\46sa\75D\46sntz\0751\46usg\75AFQjCNHyeFH4FptPFG4Qiz8nLuAsDGLO-A';return true;">help vampire" that describes the very real personality type that demands that other people online solve their problems for them. There is the site <a href="http://lmgtfy.com" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flmgtfy.com\46sa\75D\46sntz\0751\46usg\75AFQjCNG8al1uQuP5WIQcghr1rBAR-UkU4g';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flmgtfy.com\46sa\75D\46sntz\0751\46usg\75AFQjCNG8al1uQuP5WIQcghr1rBAR-UkU4g';return true;">lmgtfy.com whose purpose is to shame people who would rather not look for answers themselves.

I doubt you learned everything about programming from reading the Apple Documentation. I'm willing to bet that somewhere, somehow, somebody in the past shared some information with you. If you need more clarification, then ask for clarification. 

Believe me, I ask questions too. I'm always trying to learn new stuff, and when I get stuck I ask for help. And when I do I make sure to get to the point, include all the necessary context, and generally make it as easy as possible for someone to help me, because I am very aware that they are donating that time out of the goodness of their heart.

And I did ask for clarification. I pointed out that the question was too vague and invited him to find out what this "tag" he was looking for was and post a better question. And yes, I did it in a somewhat snarky way, to send a message that what he was doing was inappropriate.

Jens, if you need anymore help, ask here again and I'll look it up and be sure to give you the correct answer. 

Um, the guy asking the question was named Terrill.

—Jens

PS: Sorry this turned into a rant. As you can tell, it's a bit of a sore spot for me, and I usually bite my tongue and just ignore lame questions. I'm also for unrelated reasons having a bad day today and am in a grumpy mood, so you set off the flame-bot. Nothing personal.

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/8dfdc9f8-19a5-4f2a-a574-cffadb51fea3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tags in Swift

Jens Alfke

On Jan 25, 2015, at 3:35 PM, Darrell Nicholas <[hidden email]> wrote:

Yes his question was too vague in the beginning, but from the way the posts were displayed on my screen, he had been asked for clarification and had came back with it. I knew what he was talking about. That's why I quoted it.

Honestly his second question didn't make any more sense to me than the first — I think because "under view in Xcode" made me think of the View menu, which made me think he was asking something like tagging lines in the editor (like the way you can in TextMate, for example.)

But look, there's a TON of new coding bootcamps popping up, tutorial sites everywhere, and the bottom line is there are about to be a lot of people on every forum asking questions the wrong way.

This is a good point. I'm not sure how to answer it, because while these people really do deserve support, it is a big time-sink to shoot a vague unanswerable question to a large number of people, a couple of whom will spend time writing back to ask for clarification or answering a different question that they thought was being asked, and then having to iterate over that a few times.

(Old Usenet clients like "rn" used to come with a warning that popped up the first time you posted — something like "This post is going to be sent to thousands of computer systems and be read by hundreds of people. Are you sure it's worthwhile and clear?")

When I first started I didn't ask a question for a whole year online because I didn't want to look stupid or have someone smart off to me and make me quit learning. I didn't grow up in an area where there are any universities, much less colleges or high schools, that taught any form of computer science.

I've almost never seen someone be flamed simply for not knowing things. What tends to bug people is communication problems — not asking comprehensibly, not listening to earlier answers, asking the same thing over and over, demanding answers. Sometimes this is just lack of fluency (lots of people don't speak English natively) but in a small fraction of cases it's basically just rude and I will call people on that.

I don't know any other way to put it, fucking be nice! It won't kill you.

I think that I've contributed a lot of information to people over the years, on a lot of forums, with about a 99.5% politeness record. So I'll take a pass on the lecture, if you don't mind.

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/FBFBA6CF-A9BD-4289-8016-A6E592153E83%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.