I have a UITextfield which has clear button enabled only while editing and it as shown in image attached.

What i need is when i tap on clear button of UITextfield it should do few custom activity along with clearing the UItextfield. As of now it only clears the UITextField only. It is not specific to clear/ dismiss keyboard.
Thanks
