Swift – how to read data from many UITextFields which generate data by UIPickerView [closed]

You can set a pickerView as the textField.inputView. The example below is for two text fields sharing a single picker view, but you can extend it easily by checking the identity of the activeTextField in the picker view delegate methods. import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var myTextFieldOne: UITextField! @IBOutlet weak … Read more

get UITextField Tag in Custom Methods

//yourviewcontroller.h @interface ViewController : UIViewController { int tag; } //yourviewcontroller.m – (void)viewDidLoad { [super viewDidLoad]; tag = 0; } – (BOOL)textFieldShouldBeginEditing:(UITextField *)textField// return NO to disallow editing. { tag = textField.tag; return YES; } – (IBAction)cancelNumberPad:(UITextField*)textField { NSLog(@”The user is typing in text field %d”,tag); } – (IBAction)doneWithNumberPad:(UITextField*)textField { NSLog(@”The user is typing in text … Read more