Swiftpack.co - Ryu0118/AuthField as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Ryu0118.
Ryu0118/AuthField 0.1.0
AuthField is customizable pin code field like apple 2-factor authentication (自作Libraryの練習1)
⭐️ 0
🕓 2 weeks ago
iOS
.package(url: "https://github.com/Ryu0118/AuthField.git", from: "0.1.0")

AuthField

AuthField is customizable pin code field.

Installation

pod 'AuthField'

Usage

let authField = AuthField(pinCount: 6)
view.addSubview(authField)

Customization

let authFieldConfiguration = AuthFieldConfiguration(
    pinCount: 6,
    font: .boldSystemFont(ofSize: 25),
    spacing: 12,
    boxWidth: 42,
    boxHeight: 52,
    borderColor: .lightGray,
    selectedBorderColor: .systemGreen,
    borderWidth: 1,
    selectedBorderWidth: 2,
    boxCornerRadius: 12,
    boxBackgroundColor: .white
)
let authField = AuthField(configuration: authFieldConfiguration)
view.addSubview(authField) 

properties

authField.pin = 123456 // default pin code
authField.isSpaceInTheMiddleEnabled = true // Put a space in the middle of the boxes.

Delegation

authField.delegate = self

Called when all pin codes have been entered

extension ViewController : AuthFieldDelegate {
    func endEditing(_ authField: AuthField, pinCode: Int) {
        print(pinCode)
    }
}

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

0.1.0
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics