Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any TTPickerTextField alternative? perhaps in iOS4?

Is there an alternative or new stuff in iOS4 that resembles TTPickerTextField

I am looking for a way to recreate the "new mail" control view and I've read about TTPickerTextField. Three20 is my last option (especially as it has no iPad version) and I wanted to know if iOS4 gives some new UI controls to do this.

like image 995
Chen Harel Avatar asked Oct 15 '22 03:10

Chen Harel


1 Answers

Here is a dump (with some details clipped out) of the view hierarchy of a mail composer on iPhone.

<UILayoutContainerView>
   | <UINavigationTransitionView>
   |    | <UIViewControllerWrapperView>
   |    |    | <MFMailComposeView>
   |    |    |    | <UIView>
   |    |    |    |    | <MFComposeScrollView>
   |    |    |    |    |    | <UIView>
   |    |    |    |    |    |    | <_MFComposeRecipientView>
   |    |    |    |    |    |    |    | <UIView>
   |    |    |    |    |    |    |    | <MFRecipientTextField>
   |    |    |    |    |    |    |    | <MFHeaderLabelView>
   |    |    |    |    |    |    | <MFComposeMultiView>
   |    |    |    |    |    |    |    | <UIView>
   |    |    |    |    |    |    |    | <MFHeaderLabelView>
   |    |    |    |    |    |    |    | <UILabel>
   |    |    |    |    |    |    | <MFComposeSubjectView>
   |    |    |    |    |    |    |    | <UIView>
   |    |    |    |    |    |    |    | <MFHeaderLabelView>
   |    |    |    |    |    |    |    | <UITextField>
   |    |    |    |    |    |    |    |    | <UITextFieldLabel>
   |    |    |    |    |    | <MFComposeTextContentView>
   |    |    |    |    |    |    | <MFComposeBodyField>
   |    |    |    |    |    | <UIImageView>
   |    |    |    |    |    | <UIImageView>
   | <UINavigationBar>
   |    | <UINavigationItemView>
   |    | <UINavigationButton>
   |    |    | <UIImageView>
   |    |    | <UIButtonLabel>
   |    | <UINavigationButton>
   |    |    | <UIImageView>
   |    |    | <UIButtonLabel>

You will find that all of the MFCompose___Views are not documented. This means they are off limits. As far as I've seen, there is no such control available in iOS 4.

I don't recommend Three20 just to use one element. It substantially increases compile time, and I've found several bugs with Three20. It's good, but could be much better.

I would highly recommend checking out Cocoa Controls, if you haven't already. You might find what you want there. Github is also another great source.

If you do end up using TTPickerTextField and find that it's buggy, you can always rewrite the code from scratch or fix the bug in the source code.

EDIT:

I found a control via Cocoa Controls that should do what you want. You can find it on Github. It's called TITokenFieldView.

Here's another one on Github called JSTokenField.

I've never used either token field, so I can't vouch for their quality.

like image 172
rbrown Avatar answered Nov 02 '22 04:11

rbrown