I am trying to implement a reusable UITextFieldDelegate
class as follows:
class CustomTextFieldDelegate : NSObject, UITextFieldDelegate
All delegate protocol methods are implemented correctly.
In the controller
, I assign the delegate
to the UITextField
textField.delegate = CustomTextFieldDelegate()
The problem is that none of the delegate functions get called. However, when I implement the delegate protocol from the controller, then things work fine
class CustomTableViewController: UITableViewController, UITextFieldDelegate
Any ideas what is going on?