I would like to achive the same functinoanlity in the UITextField control as Google search web site (which uses Ajax for this): as user start typing, list of suggestion searches is shown. Then more letteres you type, suggestion list changes.
So imaging I have array of words:
Apple
Abc
Aman
As user types A, all thress suggesions are shown, if user type one more letter p, then Apple is suggested.
How would I do something like this? Mail type of applicatins do it, when receipent name is typed in the To: edit control
I guess I can use UITableView with the search, is it correct approach?
You want a UISearchBar. It's designed to do exactly this. Its delegate provides the list to search and present.
Related
I am looking to create some sort of search view controller that searches a tableview of names. What I want is very similar to the implementation found in the Path app. It starts out looking similar to the UISearchViewController, except that the search bar at the top is not the standard bar:
Then, when you select a name from your search, it appears surrounded in a blue bubble (like apple's mail app) and gives you the option to add more people like this:
Does anybody know how this behavior can be recreated? I feel like it might be something in uikit as they use the same blue bubble's in the mail app, but perhaps it is not.
Regardless, I would really appreciate knowing how this is done.
Thanks,
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
Venmo just open sourced their token field.
https://github.com/venmo/VENTokenField.git
edited:
The equivalent control in desktop Cocoa is an NSTokenField, but there doesn't seem to be an equivalent for Cocoa Touch.
Since iOS 13 there exists UISearchTextField.
https://developer.apple.com/documentation/uikit/uisearchtextfield
You can see that component in action in the Photos App.
That should fit for many use cases. By removing the leftView you can also get rid of the search icon.
But be aware: You can‘t mix text and tokens at various positions.
From the docs:
Tokens always occur contiguously before any text in the search field.
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.
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
I have one question, may be it is very simple, but I do not know about this nothing...
For example, I have an application, application with textfield, I want to know two things.
First: Is possible to switch keyboard when application in runtime?
Second: how I can switch type of keyboard(Russian, English, Swedish, etc.) in my application*?
*-without going to Settings->General->Keyboard->add new keyboard.
Not sure about changing languages (I did find this other post about it: change input source language programmatically OSx), but changing the keyboard is pretty easy. Here is a one line example:
textField.keyboardType = UIKeyboardTypeURL;
Take a look at the UITextInputTraits protocol reference for more info. Then the question comes in where to implement this. I am assuming that you want to check conditions right before the keyboard comes up, you may have to implement UITextFieldDelegate protocol (and maybe using the field's tag to see which field the cursor is in).
Hope this helps.
I am writing an application using Objective-C for iPhone.
In this application, the user, while entering a new record, needs to have a lookup capability (such as state, gender, phone type, etc). In C# i usually use a drop down combo or something like that to accomplish this task. What is the equivalent in Objective-C? Can someone show me a sample application?
Take a look at UIPickerView. It uses a spinning wheel to show a set of values that can be selected by the user. You need to create an object that adopts the UIPickerViewDelegate protocol to handle responding to what the user selects, and an object that adopts UIPickerViewDataSource protocol to populate the picker view.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html
The equivalent would be a UIPickerView
If you want to choose a date then use UIDatePicker.
UIPickerView is pretty much the same thing as a dropdown combo box, except without the dropdown part
I prefer to use UIActionSheet. Works quite well as combo box.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActionSheet_Class/Reference/Reference.html
there is an iOS combobox api that might help you add a combobox component to your app. Check it here: http://www.chupamobile.com/products/details/365/ZComboBox/
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
Venmo just open sourced their token field.
https://github.com/venmo/VENTokenField.git
edited:
The equivalent control in desktop Cocoa is an NSTokenField, but there doesn't seem to be an equivalent for Cocoa Touch.
Since iOS 13 there exists UISearchTextField.
https://developer.apple.com/documentation/uikit/uisearchtextfield
You can see that component in action in the Photos App.
That should fit for many use cases. By removing the leftView you can also get rid of the search icon.
But be aware: You can‘t mix text and tokens at various positions.
From the docs:
Tokens always occur contiguously before any text in the search field.
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.
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