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
🕓 1 year ago
iOS
.package(url: "https://github.com/Ryu0118/AuthField.git", from: "0.1.0")

AuthField

AuthField is customizable pin code field like apple 2-factor authentication

gif

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 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

0.1.0
1 year ago

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