Change UITextField background when editing begins

后端 未结 4 1528
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 11:12

I\'d like to change the background image of a UITextField when it becomes the firstResponder to show the user that it has focus, similar to the :active or :focus pseudo-clas

4条回答
  •  佛祖请我去吃肉
    2020-12-29 11:46

    SWIFT 4

    textField.addTarget(self, action: #selector(anyFunction), for: UIControlEvents.editingDidBegin)
    
    
    @objc func anyFunction() {
        // Add your conde here
    }
    

提交回复
热议问题