hide keyboard for text field in swift programming language

后端 未结 14 1099
不思量自难忘°
不思量自难忘° 2020-11-27 17:07

I have little experience in Objective-C. I want to hide the keyboard for a text field using the Swift programming language.

I also tried this

func te         


        
14条回答
  •  醉酒成梦
    2020-11-27 17:50

    In order to hide the keyboard when you pressed a button, you need to use the following function.

    self.view.endEditing(true)
    

    This works when a button is pressed.

    Hope this helps someone out there.

提交回复
热议问题