Latest 3.1.0
Homepage https://github.com/mohamede1945/NextResponderTextField
License MIT
Platforms ios 8.0, requires ARC
Authors

DEPRECATED

No longer maintaing it.

Swift Version

Version
License
Platform

Supports Swift 3.0!

Represents a next responder UITextField.
When the instance becomes first responder, and then the user taps the action button (e.g. return keyboard key)
then one of the following happens:

  1. If no nextResponderField set, keyboard dismissed.
  2. If nextResponderField is a UIButton and disabled, then keyboard dismissed.
  3. If nextResponderField is a UIButton and enabled, then the UIButton fires touch up inside event (simulating a tap).

You can set nextResponderField to any UIResponder subclass, and it will become first responder when tapped.
But having multiple NextResponderTextField pointing to each other, then you can go to next field.

The typical usage will be list of NextResponderTextField and the last one point to a UIButton.

For example a login screen:
Username -> NextResponderTextField
Password -> NextResponderTextField
Sign In -> UIButton

Username.nextResponderField -> Password
Password.nextResponderField -> Sign In

Requirements

  • iOS 8.0+
  • Xcode 10.0
  • Swift 4.0

Usage

Interface builder:
  1. Drag and drop a UITextField.
  2. Change the class name to NextResponderTextField from identity inspector.
  3. Change the Module name to NextResponderTextField from identity inspector.
    Step 2
  4. Do the previous steps multiple times.
  5. Wire each field with the next one like that
    Step 4
  6. You can wire the last field with a UIButton to fire it.
    Step 5
Programmatically:

Alternatively, you can create it from code just as you create a normal UITextField
and set the nextResponderField property to the next UITextField or UIButton or even any UIResponder subclass.

Important

You can set the keyboard "Return Key" to anything (Done, Next, etc.)

Demo

Step 4

Installation

For iOS 8 or later:

NextResponderTextField is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NextResponderTextField"

For iOS 7.x:

Embedded frameworks require a minimum deployment target of iOS 8.

To use NextResponderTextField with a project targeting iOS 7, you must include NextResponderTextField.swift directly into your project.

Author

Mohamed Afifi, [email protected]

License

NextResponderTextField is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NextResponderTextField",
    "version": "3.1.0",
    "summary": "Automatically moves to the next UITextField when tapping the keyboard action button",
    "description": "**Supports Swift 4.0!**nnRepresents a next responder UITextField.nWhen the instance becomes first responder, and then the user taps the action button (e.g. return keyboard key)nthen one of the following happens:n1. If no nextResponderField set, keyboard dismissed.n2. If nextResponderField is a UIButton and disabled, then keyboard dismissed.n3. If nextResponderField is a UIButton and enabled, then the UIButton fires touch up inside event (simulating a tap).nnYou can set nextResponderField to any UIResponder subclass, and it will become first responder when tapped.nBut having multiple NextResponderTextField pointing to each other, then you can go to next field.nnThe typical usage will be list of NextResponderTextField and the last one point to a UIButton.nnFor example a login screen:nUsername -> NextResponderTextFieldnPassword -> NextResponderTextFieldnSign In -> UIButtonnnUsername.nextResponderField -> PasswordnPassword.nextResponderField -> Sign In",
    "homepage": "https://github.com/mohamede1945/NextResponderTextField",
    "screenshots": "https://raw.githubusercontent.com/mohamede1945/NextResponderTextField/master/screenshots/demo.gif",
    "license": "MIT",
    "authors": {
        "Mohamed Afifi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mohamede1945/NextResponderTextField.git",
        "tag": "3.1.0"
    },
    "social_media_url": "https://twitter.com/mohamede1945",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Sources/**/*.swift"
}

Pin It on Pinterest

Share This