ios - How to apply textFieldShouldBeginEditing on one specific UITextField in Swift -
i have 4 text fields address, city, state, , zip. need call picker view state field only, need hide keyboard on state text field. i'm trying in textfieldshouldbeginediting function using piece of code, it's applying text fields.
func textfieldshouldbeginediting(state: uitextfield) -> bool { return false } i applying piece of code text fields keyboard hide on return
func textfieldshouldreturn(textfield: uitextfield!) -> bool { self.view.endediting(true) return false } so of text fields here in viewdidload
address.delegate = self city.delegate = self zip.delegate = self state.delegate = self i hope specific enough. help!
in delegate call-back, can verify 'textfield' text-fields. ex:
func textfieldshouldreturn(textfield: uitextfield!) -> bool { if textfield == address { self.view.endediting(true) return false } ... }
Comments
Post a Comment