iPhone how to get UITextField's text while typing?

后端 未结 7 2027
别那么骄傲
别那么骄傲 2020-12-12 21:54

I\'m trying to show changes made to a UITextField on a separate UILabel. Is there a way to capture full text of the UITextField after

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 22:19

    Swift with addTarget Swift 2.0+

       titleTextField.addTarget(self, action: #selector(textFieldTyping), forControlEvents: .EditingChanged)
    

    And implement selector

    func textFieldTyping(textField:UITextField)
    {
        //Typing
    }
    

提交回复
热议问题