Action when the small cross button of UITextField is pressed

后端 未结 2 866
隐瞒了意图╮
隐瞒了意图╮ 2021-01-06 19:34

I can add a small cross button that is used to clear all the text in a single click in a UITextField with the following code.

textField.clearBut         


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-06 20:12

    You can use textFieldShouldClear: delegate method to handle when user taps on clear button.

提交回复
热议问题