How do you change the color of the UITextField cleanup button?
You want to use rightView and rightViewMode . Use the button and add an image that is a red clear button. Then add your goal and follow your logic.
rightView
rightViewMode
rightViewRectForBounds will also return the button size for the rightView .
rightViewRectForBounds