Disable button as long as several textfields are empty
问题 I have the following code to disable a button as long a textfield is empty: func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let text = (textField.text! as NSString).replacingCharacters(in: range, with: string) if !text.isEmpty{ addButton.isEnabled = true } else { addButton.isEnabled = false } return true } It works fine, but now that I have 3 textfields, I want the button only to be enabled, if all textfields are