Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8734405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:50:07+00:00 2026-06-13T09:50:07+00:00

How do I bind an action to the Go button of the keyboard in

  • 0

How do I bind an action to the Go button of the keyboard in iOS ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:50:08+00:00Added an answer on June 13, 2026 at 9:50 am

    Objective-C

    Assuming you’re using a UITextField, you could use the <UITextFieldDelegate> method textFieldShouldReturn.

    - (BOOL)textFieldShouldReturn:(UITextField *)textField
    {
        [textField resignFirstResponder]; // Dismiss the keyboard.
        // Execute any additional code
    
        return YES;
    }
    

    Don’t forget to assign the class you put this code in as the text field’s delegate.

    self.someTextField.delegate = self;
    

    Or if you’d prefer to use UIControlEvents, you can do the following

    [someTextField addTarget:self action:@selector(textFieldDidReturn:) forControlEvents:UIControlEventEditingDidEndOnExit];
    
    - (void)textFieldDidReturn:(UITextField *)textField
    {
        // Execute additional code
    }
    

    See @Wojtek Rutkowski’s answer to see how to do this in Interface Builder.

    Swift

    UITextFieldDelegate

    class SomeViewController: UIViewController, UITextFieldDelegate {
        let someTextField = UITextField()
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            someTextField.delegate = self
        }
    
        func textFieldShouldReturn(textField: UITextField) -> Bool {
            textField.resignFirstResponder() // Dismiss the keyboard
            // Execute additional code
            return true
        }
    }
    

    UIControlEvents

    class SomeViewController: UIViewController {
        let someTextField = UITextField()
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            // Action argument can be Selector("textFieldDidReturn:") or "textFieldDidReturn:"
            someTextField.addTarget(self, action: "textFieldDidReturn:", forControlEvents: .EditingDidEndOnExit)
        }
    
        func textFieldDidReturn(textField: UITextField!) {
            textField.resignFirstResponder()
            // Execute additional code
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a controller insert action: <AcceptVerbs(HttpVerbs.Post)> _ Function InsertObject(<Bind(Exclude:=Id)> <ModelBinder(GetType(CustomModelBinder))> ByVal object As
<form id='new_key' action='/foo/bar' method='post'> <input type=text id=u> <input type=submit value=submit> </form> I can bind
I have the following action method, when I press the update button on my
To create an image button that calls an action method you can use construction
EDIT: this works, but not sure why? $('button').each(function() { $(this).bind( click, function() { alert($(this).val());
Using a macbook keyboard (which means I do not have the 'page up' button)
In the jQuery 'ready' block, I have: // bind print work order button to
I currently have several action buttons in different pages, and each button performs some
I am trying to disable a button action link using jquery-1.5.1 but nothing seems
boost::bind overloads several operators for its placeholders: For convenience, the function objects produced by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.