How to call a method when the Done Button in the KeyBoard is Clicked?
I want to call a method when the done button is clicked in the UITextField KeyBoard? Please Help me…
2 Solutions Collect From Internet About “How to call a method when the Done Button in the KeyBoard is Clicked?”
It’s not even necessary to implement the delegate. I greatly prefer using good, old-fashioned target/action pattern to handle this. It can also lead to cleaner code if you have multiple ways of ending editing (say, intercepting touches outside the text field to cancel editing).
To use target/action, simply wire up
UIControlEventEditingDidEndOnExit, which shows up in Interface Builder as the
Did End On Exit event.
No muss, no fuss. A lot cleaner and easier than implementing the delegate.
See the UITextFieldDelegate Protocol reference. You probably want to implement the
– textFieldShouldReturn: method in your delegate.
- Data Protection on iOS
- Calling method in current view controller from App Delegate in iOS
- Using shouldPerformSegueWithIdentifier( ) method in Swift
- Unsupported operation – Apps are not allowed to listen to device lock notifications
- Do I need use dealloc method with ARC?
- Post to user's Facebook wall with iPhone using latest FBConnect SDK
- Open attachment from mail using ios 8 app
- Swift TableView Crash: “Missing cell for newly visible row”
- Custom setter for @property?
- Missing frameworks after upgrading to Xcode 3.2
- Thread-Local storage and iOS
- NSDate: Get precise time independent of device clock?
- UITraitCollection Clarification
- is there anywhere where I could start MobileSubstrate tweaks programming?