[Solved] How to set up UITextFieldDelegate for multiple text fields? [closed]

If your goal is to have all three text fields follow the same rule, set the delegate for all three. The shouldChangeCharactersIn only needs to check the “current” text field into which the user is currently typing. A minor observation, but I also would avoid recreating the CharacterSet of allowed characters repeatedly. You can simply … Read more

[Solved] Textfield values set to empty when coming back from previous view controller [closed]

When you push back to the origin viewController, It’s better to replace using “push” Segue by “popViewController” method . It’s also good using data consistent strategy. And the reason: You should consider the viewController’s lifecycle. When you push back to the origin viewController, using “push” Segue makes the origin viewController’s “viewDidLoad” method is called again. … Read more

[Solved] Calling viewDidLoad in UITextField [closed]

Call generateDummyTransactions() from sendButton’s IBAction method and then fetch the textField’s text there, i.e. class VC: UIViewController { @IBOutlet weak var providerForm: UITextField! @IBAction func onTapSendButton(_ sender: UIButton) { self.generateDummyTransactions() } func generateDummyTransactions() { if let text = self.providerForm.text { //use text here… } } } solved Calling viewDidLoad in UITextField [closed]

[Solved] Auto Adjust UITextView and UITextField on appearance on keyboard [duplicate]

This is a fairly common problem, there are all sorts of solutions to it. I put one together and made it part of my EnkiUtils package which you can download from https://github.com/pcezanne/EnkiUtils Short version: You’ll want to watch for keyboard events and call the Enki keyboardWasShown method, passing it the current view (and cell if … Read more

[Solved] How to hide keyboard on touch UITableView in iOS Obj-C

This is the simplest way to dismiss keyboard – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)]; [tableView addGestureRecognizer:gestureRecognizer]; } – (void)hideKeyboard { [self.view endEditing:YES]; } 0 solved How to hide keyboard on touch UITableView in iOS Obj-C

[Solved] 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

[Solved] Adding five Numbers Entered as Strings in Textfields [closed]

You Have To First Add 5 TextField, 1 Label For Output Result, And One Button. and Make to create that outlet.. like this… in Do it in your .h File @property (weak, nonatomic) IBOutlet UITextField *txtField1; @property (weak, nonatomic) IBOutlet UITextField *txtField2; @property (weak, nonatomic) IBOutlet UITextField *txtField3; @property (weak, nonatomic) IBOutlet UITextField *txtField4; @property … Read more

[Solved] How to display Comma separated and Fractional values in UITextfiled? [closed]

Since you want the UITextField to have a maximum of 7 integer digits, you’ll need to validate every modification, and prevent any that result in a number with > 7 integer digits. The simplest way I know to do that is the UITextFieldDelegate method shouldChangeCharactersInRange: – (BOOL) textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)string { NSString* modifiedFieldText = [textField.text … Read more