Solution is to adopt that specific delegate you're using in your class.
Like in below example:
class "Your"ViewController: UIViewController, UITextFieldDelegate
And don't forget to set your current class as the delegate, like below (for my own case):
IBOutlet weak var searchTextField: UITextField!
searchTextField.delegate = self