A customizable code textField. Can be used for phone verification codes, passwords etc.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
dependencies: [
.package(url: "github.com/quavodanceq/PinCodeTextField.git", .branch(main))
]
- Interface Builder:
Add a UITextField
in your Interface Builder and change the class of a textField from UITextField
to PinCodeTextField
. You can set the properties in the Attributes Inspector and see a live preview
![usage](https://private-user-images.githubusercontent.com/80914126/256837520-81ff425b-a4d9-4742-b70e-1cfeabc60aec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NDU0ODEsIm5iZiI6MTcyMDQ0NTE4MSwicGF0aCI6Ii84MDkxNDEyNi8yNTY4Mzc1MjAtODFmZjQyNWItYTRkOS00NzQyLWI3MGUtMWNmZWFiYzYwYWVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDEzMjYyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUyOGNiN2E0ZDhjNTkwODc3ZjExZWI4OGNmZGY3NzJhNWY2ZmExNmVjY2FjNmNkZDNjZWUxMGE5ZjE2Y2ZjNTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VIjNDsnf_TUcdlbuOfBh-ujB67PIpeLq0AXKBD8yd9o)
- Programmatically:
let textField = PinCodeTextField()
textField.emptyDigitBorderColor = .gray
textField.filledDigitBorderColor = .blue
textField.digitsCount = 4
textField.bordersSpacing = 5