{"id":2950,"url":"https://github.com/T-Pham/UITextField-Navigation","last_synced_at":"2025-08-06T16:31:37.751Z","repository":{"id":9294708,"uuid":"61489658","full_name":"T-Pham/UITextField-Navigation","owner":"T-Pham","description":"🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews","archived":false,"fork":false,"pushed_at":"2022-01-11T15:19:26.000Z","size":1052,"stargazers_count":445,"open_issues_count":4,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-07T03:49:07.384Z","etag":null,"topics":["cartfile","carthage","cocoapods","interface-builder","ios","keyboard","podfile","storyboard","swift","uitextfield","uitextfield-navigation","uitextview","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/T-Pham.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-19T16:35:35.000Z","updated_at":"2024-10-17T01:38:59.000Z","dependencies_parsed_at":"2022-08-07T05:00:49.264Z","dependency_job_id":null,"html_url":"https://github.com/T-Pham/UITextField-Navigation","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FUITextField-Navigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FUITextField-Navigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FUITextField-Navigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FUITextField-Navigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-Pham","download_url":"https://codeload.github.com/T-Pham/UITextField-Navigation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228556855,"owners_count":17936435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartfile","carthage","cocoapods","interface-builder","ios","keyboard","podfile","storyboard","swift","uitextfield","uitextfield-navigation","uitextview","xcode"],"created_at":"2024-01-05T20:16:27.179Z","updated_at":"2024-12-09T16:31:08.320Z","avatar_url":"https://github.com/T-Pham.png","language":"Swift","funding_links":[],"categories":["UI","Libs","UI [🔝](#readme)"],"sub_categories":["TextField \u0026 TextView","UI","Layout","Other free courses"],"readme":"```\n'           __________________ _______          _________ _______ _________ _______  _        ______  \n'  |\\     /|\\__   __/\\__   __/(  ____ \\|\\     /|\\__   __/(  ____ \\\\__   __/(  ____ \\( \\      (  __  \\ \n'  | )   ( |   ) (      ) (   | (    \\/( \\   / )   ) (   | (    \\/   ) (   | (    \\/| (      | (  \\  )\n'  | |   | |   | |      | |   | (__     \\ (_) /    | |   | (__       | |   | (__    | |      | |   ) |\n'  | |   | |   | |      | |   |  __)     ) _ (     | |   |  __)      | |   |  __)   | |      | |   | |\n'  | |   | |   | |      | |   | (       / ( ) \\    | |   | (         | |   | (      | |      | |   ) |\n'  | (___) |___) (___   | |   | (____/\\( /   \\ )   | |   | )      ___) (___| (____/\\| (____/\\| (__/  )\n'  (_______)\\_______/   )_(   (_______/|/     \\|   )_(   |/       \\_______/(_______/(_______/(______/ \n'                                                                                                     \n'   _        _______          _________ _______  _______ __________________ _______  _                \n'  ( (    /|(  ___  )|\\     /|\\__   __/(  ____ \\(  ___  )\\__   __/\\__   __/(  ___  )( (    /|         \n'  |  \\  ( || (   ) || )   ( |   ) (   | (    \\/| (   ) |   ) (      ) (   | (   ) ||  \\  ( |         \n'  |   \\ | || (___) || |   | |   | |   | |      | (___) |   | |      | |   | |   | ||   \\ | |         \n'  | (\\ \\) ||  ___  |( (   ) )   | |   | | ____ |  ___  |   | |      | |   | |   | || (\\ \\) |         \n'  | | \\   || (   ) | \\ \\_/ /    | |   | | \\_  )| (   ) |   | |      | |   | |   | || | \\   |         \n'  | )  \\  || )   ( |  \\   /  ___) (___| (___) || )   ( |   | |   ___) (___| (___) || )  \\  |         \n'  |/    )_)|/     \\|   \\_/   \\_______/(_______)|/     \\|   )_(   \\_______/(_______)|/    )_)         \n'                                                                                                     \n```\n\n# UITextField-Navigation\n\n[![CI Status](https://img.shields.io/travis/T-Pham/UITextField-Navigation/master.svg?style=flat-square)](https://travis-ci.org/T-Pham/UITextField-Navigation)\n[![GitHub issues](https://img.shields.io/github/issues/T-Pham/UITextField-Navigation.svg?style=flat-square)](https://github.com/T-Pham/UITextField-Navigation/issues)\n[![Codecov](https://img.shields.io/codecov/c/github/T-Pham/UITextField-Navigation.svg?style=flat-square)](https://codecov.io/gh/T-Pham/UITextField-Navigation)\n[![Documentation](https://img.shields.io/static/v1.svg?label=Documentation\u0026message=✅\u0026style=flat-square)](http://cocoadocs.org/docsets/UITextField-Navigation/3.0.0/)\n\n[![GitHub release](https://img.shields.io/github/tag/T-Pham/UITextField-Navigation.svg?style=flat-square\u0026label=release)](https://github.com/T-Pham/UITextField-Navigation/releases)\n[![Platform](https://img.shields.io/cocoapods/p/UITextField-Navigation.svg?style=flat-square)](https://github.com/T-Pham/UITextField-Navigation)\n[![License](https://img.shields.io/cocoapods/l/UITextField-Navigation.svg?style=flat-square)](LICENSE)\n\n[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)\n\n[![CocoaPods](https://img.shields.io/badge/CocoaPods-compatible-4BC51D.svg?style=flat-square)](https://cocoapods.org/pods/UITextField-Navigation)\n\n[![Say thanks!](https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg?style=flat-square)](https://saythanks.io/to/T-Pham)\n\n## Description\n\nUITextField-Navigation adds next, previous and done buttons to the keyboard for your `UITextField`s and `UITextView`s. It allows you to specify a next field either on the Interface Builder or programmatically. Then, you can access next and previous fields of each `UITextField` or `UITextView` easily.\n\nThe UI is [**highly customizable**](#ui-customization). RTL languages are supported.\n\nTo run the example project:\n\n`pod try UITextField-Navigation`\n\n![Screenshot 0](https://github.com/T-Pham/UITextField-Navigation/blob/master/Screenshots/screenshot0.png?raw=true)\n![Screenshot 1](https://github.com/T-Pham/UITextField-Navigation/blob/master/Screenshots/screenshot1.png?raw=true)\n![Screenshot 2](https://github.com/T-Pham/UITextField-Navigation/blob/master/Screenshots/screenshot2.gif?raw=true)\n\n## Usage\n\n### Basic\n\nYou can set the `nextNavigationField` property for each `UITextField` and `UITextView` either on the Interface Builder or programmatically. The `previousNavigationField` property will be set on the other `UITextField` or `UITextView` automatically for you.\n\nExample:\n\n```swift\nimport UITextField_Navigation\n\n...\nlet textField = UITextField()\nlet textView = UITextView()\ntextField.nextNavigationField = textView\n\nassert(textView == textField.nextNavigationField)\nassert(textField == textView.previousNavigationField)\n```\n\nPlease note that the `nextNavigationField` and `previousNavigationField` properties are not retained.\n\n### Capturing taps\n\nTo capture taps on the next, previous and done buttons, assign a `delegate` to your `NavigationField`, which is a `UITextField` or `UITextView`, also either on the Interface Builder or programmatically. Then implement the `NavigationFieldDelegate` protocol (in addition to the `UITextFieldDelegate` or `UITextViewDelegate` protocol) for the `delegate`.\nPlease note that you have to explicitly declare that the `delegate` conforms to the `NavigationFieldDelegate` protocol to make it work.\n\n\u003cdetails open\u003e\n\u003csummary\u003eSwift:\u003c/summary\u003e\n\n```swift\nimport UIKit\nimport UITextField_Navigation\n\n...\nextension ViewController: NavigationFieldDelegate { // explicitly protocol conforming declaration\n\n    func navigationFieldDidTapPreviousButton(_ navigationField: NavigationField) {\n        navigationField.previousNavigationField?.becomeFirstResponder()\n        // your custom work\n    }\n\n    func navigationFieldDidTapNextButton(_ navigationField: NavigationField) {\n        navigationField.nextNavigationField?.becomeFirstResponder()\n        // your custom work\n    }\n\n    func navigationFieldDidTapDoneButton(_ navigationField: NavigationField) {\n        navigationField.resignFirstResponder()\n        // your custom work\n    }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C:\u003c/summary\u003e\n\n```objective-c\n@import UITextField_Navigation;\n#import \"ViewController.h\"\n\n@interface ViewController () \u003cNavigationFieldDelegate\u003e // explicitly protocol conforming declaration\n\n...\n#pragma mark - NavigationFieldDelegate\n\n- (void)navigationFieldDidTapPreviousButton:(id\u003cNavigationField\u003e)navigationField {\n    [navigationField.previousNavigationField becomeFirstResponder];\n    // your custom work\n}\n\n- (void)navigationFieldDidTapNextButton:(id\u003cNavigationField\u003e)navigationField {\n    [navigationField.nextNavigationField becomeFirstResponder];\n    // your custom work\n}\n\n- (void)navigationFieldDidTapDoneButton:(id\u003cNavigationField\u003e)navigationField {\n    [navigationField resignFirstResponder];\n    // your custom work\n}\n```\n\n\u003c/details\u003e\n\n### Set button titles\n\nThe titles of the previous, next and done buttons can be modified for each instant by setting the `title` property of each corresponding button.\n\n```swift\nnavigationField.navigationFieldToolbar?.previousButton.title = \"Previous\"\nnavigationField.navigationFieldToolbar?.nextButton.title = \"Next\"\nnavigationField.navigationFieldToolbar?.doneButton.title = \"Dismiss\"\n```\n\nOr they can be set globally for all instances using `Config`.\n\n```swift\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    UITextField_Navigation.Config.previousButtonTitle = \"Previous\"\n    UITextField_Navigation.Config.nextButtonTitle = \"Next\"\n    UITextField_Navigation.Config.doneButtonTitle = \"Done\"\n    return true\n}\n```\n\n### UI Customization\n\n#### Using UIAppearance\n\nModify the appearance proxy of the `NavigationFieldToolbar` and `NavigationFieldToolbarButtonItem` classes to customize the navigation view's UI for all fields.\n\n```swift\nNavigationFieldToolbar.appearance().barStyle = .black\nNavigationFieldToolbar.appearance().backgroundColor = .purple\nif #available(iOS 11.0, *) {\n    UIButton.appearance(whenContainedInInstancesOf: [NavigationFieldToolbar.self]).tintColor = .white\n} else {\n    NavigationFieldToolbarButtonItem.appearance().tintColor = .white\n}\n```\n\n![Screenshot 3](https://github.com/T-Pham/UITextField-Navigation/blob/master/Screenshots/screenshot3.png?raw=true)\n\n#### Directly and adding more buttons\n\nAlternatively, you can directly modify the UI of each navigation view by accessing the `navigationFieldToolbar` property of a `UITextField` or `UITextView`.\n\n```swift\n...\nnavigationField.navigationFieldToolbar?.barStyle = .default\nnavigationField.navigationFieldToolbar?.backgroundColor = .red\n\n// Add a custom button\nlet customButton = UIBarButtonItem(title: \"Custom\", style: .plain, target: nil, action: nil)\nlet flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)\nnavigationField.navigationFieldToolbar?.items = [navigationField.navigationFieldToolbar!.previousButton, navigationField.navigationFieldToolbar!.nextButton, customButton, flexibleSpace, navigationField.navigationFieldToolbar!.doneButton]\n```\n\n![Screenshot 4](https://github.com/T-Pham/UITextField-Navigation/blob/master/Screenshots/screenshot4.png?raw=true)\n\n## Installation\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\nAdd the line below to your Cartfile:\n\n```ruby\ngithub \"T-Pham/UITextField-Navigation\"\n```\n\n### [CocoaPods](https://cocoapods.org/pods/UITextField-Navigation)\n\nAdd the line below to your Podfile:\n\n```ruby\npod 'UITextField-Navigation'\n```\n\n### Manually\n\n1. Download and drop [`/UITextField-Navigation/Classes`](/UITextField-Navigation/Classes) folder in your project.\n2. Congratulations!\n\n## Compatibility\n\n- Swift 4, 5: please use the latest version\n- Swift 3: please use version 3.0.0\n- Swift 2: please use version 1.4.3\n\n## Apps that use UITextField-Navigation\n\nHello fellow developers. I can see that the library has been adopted in some apps. If your app also uses the library, it would be great if you can share it here. Please add it to the list below. Thanks!\n\n1. [Catder - Random animated cat photos](https://itunes.apple.com/us/app/catder-random-animated-cat/id1123343798?ls=1\u0026mt=8)\n2. [Gradus - a Grade Calculator](https://itunes.apple.com/ca/app/gradus-a-grade-calculator/id1063184658?mt=8)\n\n## License\n\nUITextField-Navigation is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-Pham%2FUITextField-Navigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FT-Pham%2FUITextField-Navigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-Pham%2FUITextField-Navigation/lists"}