NerdzPinView is a highly customisable library used for entering pin and one time codes.
NerdzPinView library supports both UIKIt and SwiftUI frameworks.
To add NerdzPinView to a Swift Package Manager based project add it using Xcode add package command or add it as a dependency inside your Package.swift
file:
.package(url: "https://github.com/RomanKovalchukDev/NerdzPinView")
Clone the repo and drag files from NerdzPinView/Sources
folder into your Xcode project.
NerdzPinView library provides complete SwiftUI wrapper over custom UIKeyInput component. To use it inside your SwiftUI application just add NerdzBorderedPinView
or NerdzUnderlinePinView
inside your view body.
SwiftUI views have text
, viewState
, and isFocused
binding properties alongside UIKeyInput properties that are passed to the wrapped view.
You could take a look into the usage of the library inside SwiftUI project using SwiftUI demo project.
To use the library from the xib files or storyboards you should use DesignableBorderedPinInputView
or DesignableUnderlinedPinInputView
- this two classes are predefined views that are wrapers around generic PinCodeInputView
.
You could also use generic PinCodeInputView
programatically. This use case mostly needed for you to provide your own item display view.
You could take a look into the usage of the library inside SwiftUI project using SwiftUI demo project.
- iOS 16.0 +
- Xcode 16.0 +
NerdzPinView is available under the MIT license. See LICENSE for details.