https://github.com/zaimramlan/ios-secure-code-entry
An iOS app that imitates Apple's passcode entry
https://github.com/zaimramlan/ios-secure-code-entry
character passcode prototype secure single swift uitextfield
Last synced: 7 months ago
JSON representation
An iOS app that imitates Apple's passcode entry
- Host: GitHub
- URL: https://github.com/zaimramlan/ios-secure-code-entry
- Owner: zaimramlan
- License: mit
- Created: 2018-05-14T18:08:40.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2019-10-06T09:19:50.000Z (almost 6 years ago)
- Last Synced: 2025-01-18T17:30:57.939Z (9 months ago)
- Topics: character, passcode, prototype, secure, single, swift, uitextfield
- Language: Swift
- Homepage:
- Size: 1.12 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Secure Code Entry
[](https://developer.apple.com/xcode/)
[](https://developer.apple.com/ios/)
[](https://swift.org)
[](LICENSE)An iOS app that imitates Apple's passcode entry to showcase the a single digit UITextField custom class; `SecureCodeTextField`.
## Features
1. Only allow a single digit per textfield
1. Disables UITextField action menu commands to prevent copy/paste
1. Cursor auto moves to previous/next textfield after a single character text entry
1. Works with arbitrary amount of textfields on screen## Usages
1. Copy and paste SecureCodeTextField.swift into your project
1. Set the custom class of the `UITextField`s on your storyboard file to `SecureCodeTextField`
1. Point the current `SecureCodeTextField`'s `previousTextField` and `nextTextField` to the respective text fields. For example:
```swift
let firstTF = SecureCodeTextField()
let secondTF = SecureCodeTextField()
let thirdTF = SecureCodeTextField()secondTF.previousTextField = firstTF
secondTF.nextTextField = thirdTF
```
1. Your textfields should now jump to previous/next textfields as desired!## More Examples?
Look into the ViewController.swift file and you should be able to understand in the scenario where we have 4 `SecureCodeTextFields`s