ios - How to close keyboard in textfield -
today next tutorial: http://youtu.be/9rq4p-l-z8u. however, when came part showed how close keyboard after pressing button
, followed instructions, when started simulator, keyboard simulator never appeared on screen. how can prepare this?
this code:
class viewcontroller: uiviewcontroller { @iboutlet var textfield: uitextfield! @iboutlet var label: uilabel! @ibaction func buttonmethod(sender: anyobject) { label.text = textfield.text textfield.resignfirstresponder() } }
@ibaction func buttonmethod(sender: anyobject) { self.view.endediting(true) }
this remove keyboard screen when press on button
edit: since title different question answer:
uncheck connect hardware keyboard
ios swift
No comments:
Post a Comment