Sunspension / VKPinCodeView

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.
MIT License
96 stars 25 forks source link

Can't add toolbar above numberPad #11

Closed nikoagge closed 3 years ago

nikoagge commented 4 years ago

I want to add a doneToolbar above numberPad to dismiss it when I want, but can't implement it, although I 've seen several tutorials. The code that I 've trying to implement is this:

let toolBar = UIToolbar(frame: CGRect(origin: .zero, size: .init(width: self.frame.size.width, height: 40)))

    let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
    let doneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(dismissNumberPad(_:)))

    toolBar.setItems([flexSpace, doneButton], animated: false)
    toolBar.sizeToFit()

    _textField.inputAccessoryView = toolBar

Any suggestions why is this happening?

Sunspension commented 4 years ago

@nikoagge Have you checked whether your code execute on debug? Because I have no issues and I can see toolbar above the keyboard