views:

359

answers:

3

Hi there,

In my app I want the user to type names into a UITextField (or equivalent) and then when they press return, it will put that word(s) in a blue bubble that's usually associated with tags. The cursor then moves to the end where they can add more "tags".

This can be seen when adding contacts in the To, CC & BCC fields in the Mail app, and also when selecting contacts in the Messages app.

How is this done? Is it something that's provided in the UIKit or available somewhere else?

Many thanks,

Michael

A: 

I dont think you can do it with any built in functionality in the SDK, never seen such a feature. What you could do however is implement it yourself, have some custom blue button with some text over it, and when the user hits return you can have some code that takes the text and returns you the button that you need, shouldnt be too bad to implement

Daniel
A: 

edited:

The equivalent control in desktop Cocoa is an NSTokenField, but there doesn't seem to be an equivalent for Cocoa Touch.

e.James
That's for Cocoa (OS X), not Cocoa Touch (iPhone)
rpetrich
Argh. So it is. Sorry about that.
e.James
Simple mistake. Maybe in 4.0 :)
rpetrich
+3  A: 

Apple doesn't include that control in the public SDK. As a part of the Three20 project, Joe Hewett has written a TTPickerTextField class you can use instead.

rpetrich
Thanks, I actually ended up writing my own but I've since looked at his and it's pretty good!
Michael Waterfall