DEV Community

Mateusz Budnik
Mateusz Budnik

Posted on

4 1

Replacing image in clear button


Default clear button

To change default clear button icon, you have to create binding to your text field and then pass the following lines of code:

if let clearButton = someTextField.value(forKeyPath: "_clearButton") as? UIButton {
            clearButton.setImage(UIImage(named:"image_name"), for: .normal)
        }
Enter fullscreen mode Exit fullscreen mode

To change size of the icon you can upload to the project the image with the appropriate size.


Changed clear button

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post