Input predictable on iOS
Whenever a user provides input, there should be no change of context
. Example of changing context include, but are not limited to: automatically submitting data, opening a new screen or moving to another element. Input should have predictable effects.
With iOS, be careful when using UITextFieldDelegate
methods. Do not trigger a change of context when text changes.
extension ApptViewController: UITextFieldDelegate {
func textField(_ textField: UITextField,
shouldChangeCharactersIn range: NSRange,
replacementString string: String) -> Bool {
// Do not change context
return true
}
}