UI Picker View As Input Type For UI Text Field In iOS (Swift 3 + Xcode 8)
UI Picker View As Input Type For UI Text Field In iOS Hi, In this post, I’ll show you how to create an UI Picker View for UI Text Field in iOS. I am using Swift 3 and Xcode 8 for this tutorial. So, let’s start and see how to do it.. First of all, open your Xcode and create a Single View Application. Now, open your main.storyboard and drag a textfield on your view controller. Add some constraints on this text field as shown in the picture below: Now, create an outlet for your added text field. For that make sure to open up the assistant editor and ctrl+drag the UI textfield to your ViewController.swift file. Once its done, close the assistant editor and open your ViewController.swift file. Here, first add UIPickerViewDataSource and UIPickerViewDelegate methods in your class declaration as shown below: class ViewController: UIViewController , UIPickerViewDataSource , UIPickerViewDelegate Now, first create your picker view object. ...