How can I make it so that when the contents of a text field changes, a function is called?
Objective-C
[myTextField addTarget:self
action:@selector(textFieldDidChange:)
forControlEvents:UIControlEventEditingChanged];
Swift 4
myTextField.addTarget(self, action: #selector(textFieldDidChange(sender:)), for: .editingChanged)
@objc func textFieldDidChange(sender: UITextField) {...}