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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNzkyNTIsIm5iZiI6MTcyMTM3ODk1MiwicGF0aCI6Ii84MDkxNDEyNi8yNTY4Mzc1MjAtODFmZjQyNWItYTRkOS00NzQyLWI3MGUtMWNmZWFiYzYwYWVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDA4NDkxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxMDdiYzE1MTVmNDE1NTk1NDI3M2Y4Njg4YjljNGMyZGM4YWUwMzFhZjhiZDMzZWZiY2JmNzZkN2U3ZmRjNDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HzCvvu64vIQP0x6fULUsrlRfM1zi0eAbUziDB3ttt-E)
- Programmatically:
let textField = PinCodeTextField()
textField.emptyDigitBorderColor = .gray
textField.filledDigitBorderColor = .blue
textField.digitsCount = 4
textField.bordersSpacing = 5