ASPinCodeField is a UI Component that allows you to integrate a pin / digit code UI within your app.
- iOS 9.0+
- Swift 5.0
let pinCodeView = ASPinCodeField()
pinCodeView.delegate = self
pinCodeView.dataSource = self
pinCodeView.borderColor = UIColor.lightGray
pinCodeView.textColor = UIColor.black
pinCodeView.cornerRadius = 4
pinCodeView.itemsSpacing = 8
pinCodeView.textFont = .boldSystemFont(ofSize: 20)
Delegate and DataSource
public protocol ASPinCodeFieldDelegate: class {
func pinCodeField(_ pinCodeField: ASPinCodeField, didChangeText text: String)
}
public protocol ASPinCodeFieldDataSource: class {
func numberOfDigits(in pinCodeField: ASPinCodeField) -> Int
func canPasteFromPasteBoard(_ pinCodeField: ASPinCodeField, pasteboard: String) -> Bool
}
pod 'ASPinCodeField'
github "Aymenworks/ASPinCodeField"
ASPinCodeField is released under the MIT license.