DigitInputView
DigitInputView copied to clipboard
Using OneTimeCode with DigitInputView Crashes app
When using iOS12 oneTimeCode feature on digit-input-view it crashes app, here's how I'm doing it.
func setupDigitView(){
digitView.numberOfDigits = 4
digitView.bottomBorderColor = AppTheme.placeholderColor ?? UIColor.white
digitView.nextDigitBottomBorderColor = AppTheme.placeholderColor ?? UIColor.white
digitView.textColor = UIColor.white
digitView.acceptableCharacters = "0123456789"
digitView.keyboardType = .decimalPad
digitView.animationType = .spring
digitView.font = UIFont.monospacedDigitSystemFont(ofSize: 10, weight: UIFont.Weight(rawValue: 1))
digitView.keyboardAppearance = .dark
// One time code
if #available(iOS 12.0, *) {
for view in digitView.subviews{
guard let tf = view as? UITextField else{continue}
tf.textContentType = .oneTimeCode
}
}
}
And the crash is :

Fatal error: Can't remove last element from an empty collection
Same issue
@boranyldrm I've fixed this issue you can check the solution on following https://github.com/iTatla1/DigitInputView.git repo