Skip to content

Commit

Permalink
PhoneNumberTextField: mimic UITextFieldDelegate behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
marmelroyspotify committed Sep 25, 2020
1 parent 6d996f7 commit c7d7b0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PhoneNumberKit/UI/PhoneNumberTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,13 @@ open class PhoneNumberTextField: UITextField, UITextFieldDelegate {
@available (iOS 10.0, tvOS 10.0, *)
open func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) {
updateTextFieldDidEndEditing(textField)
self._delegate?.textFieldDidEndEditing?(textField, reason: reason)
if let _delegate = _delegate {
if (_delegate.responds(to: #selector(textFieldDidEndEditing(_:reason:)))) {
_delegate.textFieldDidEndEditing?(textField, reason: reason)
} else {
_delegate.textFieldDidEndEditing?(textField)
}
}
}

open func textFieldShouldClear(_ textField: UITextField) -> Bool {
Expand Down

0 comments on commit c7d7b0c

Please sign in to comment.