VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.
// secure text after a bit
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500), execute: {
if !(textField.text?.isEmpty ?? true) {
placeholderLabel.isHidden = true
if self.shouldSecureText { textField.text = self.secureCharacter }
}
})
Can we make the 500 milliseconds configurable??
// secure text after a bit DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500), execute: { if !(textField.text?.isEmpty ?? true) { placeholderLabel.isHidden = true if self.shouldSecureText { textField.text = self.secureCharacter } } })