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

Using OneTimeCode with DigitInputView Crashes app #9

@iTatla1

Description

@iTatla1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions