Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Using OneTimeCode with DigitInputView Crashes app #9

Open
iTatla1 opened this issue Dec 31, 2018 · 2 comments
Open

Using OneTimeCode with DigitInputView Crashes app #9

iTatla1 opened this issue Dec 31, 2018 · 2 comments

Comments

@iTatla1
Copy link

iTatla1 commented Dec 31, 2018

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 :
screenshot 2018-12-31 at 9 51 57 pm
screenshot 2018-12-31 at 9 51 36 pm

Fatal error: Can't remove last element from an empty collection

@boranyldrm
Copy link
Contributor

Same issue

@iTatla1
Copy link
Author

iTatla1 commented Feb 8, 2019

@boranyldrm I've fixed this issue you can check the solution on following https://github.com/iTatla1/DigitInputView.git repo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants