Is there an iPhone equivalent to the NSTokenField control?

前端 未结 4 1026
刺人心
刺人心 2020-11-29 05:41

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 associa

相关标签:
4条回答
  • 2020-11-29 06:19

    edited:

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

    0 讨论(0)
  • 2020-11-29 06:19

    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

    0 讨论(0)
  • 2020-11-29 06:22

    Venmo just open sourced their token field.

    https://github.com/venmo/VENTokenField.git

    0 讨论(0)
  • 2020-11-29 06:42

    Adding this here for reference:

    Feel free to check out TaggerKit (a library I made), it's more or less what OP was talking about. You can basically add tags functionality to your app by just adding a view and a couple of properties.

    0 讨论(0)
提交回复
热议问题