objective c - How to associate iOS keyboard "go" button with UIButton? -
I have a search bar in my SearchViewController , and currently, when they type in If no go button, it only shows back to show me in the keyboard, a Go button, and I want to call it
- I want to connect to (IBAction) button: (ID) sender I have connected the current Next
UIButton under the search bar
I enable it And how would it be to add about this way? To make it clear, the search bar and next buttons were created in the storyboard, not programmatic.
[textField setReturnKeyType: UIReturnKeyGo]; or
- (zero) setReturnKey {// use condition here (field not empty) self.searchField.returnKeyType = UIReturnKeyGo; } As a second thing, Ghobs has said that you can find here ... Prefix: (BOOL) textFieldShouldReturn: (UITextField *) TextField {[TextField Resigns First Responder]; // Dismiss the keyboard // Add the action you want to call here. Yes come back }
Source for the above code:
Comments
Post a Comment