- April 27, 2024
- Mins Read
TextField with DropDown support using UIPickerView
Install using cocoapods. Add in your Podfile
:
pod ‘IQDropDownTextField’
Or below for Swift version
pod ‘IQDropDownTextFieldSwift’
In IB (story boards or xibs) you can add UITextField
‘s and set the class as IQDropDownTextField
Nothing more easy than it!
@implementation ViewController
– (void)viewDidLoad
{
[super viewDidLoad];
textFieldTextPicker.isOptionalDropDown = NO;
[textFieldTextPicker setItemList:[NSArray arrayWithObjects:@”London”,@”Johannesburg”,@”Moscow”,@”Mumbai”,@”Tokyo”,@”Sydney”, nil]];
}
@end
It’s very simple to setup your IQDropDownTextField
. The sample below shows you how to:
import IQDropDownTextFieldSwift
class MyController : UIViewController {
@IBOutlet var occupationTextField: IQDropDownTextField!
override func viewDidLoad() {
occupationTextField.isOptionalDropDown = false
occupationTextField.itemList = [“programmer”, “teacher”, “engineer”]
}
}
And that’s all you need! =)
Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...