IQKeyboardManager error: Value of type 'UIView' has no member 'keyboardToolbar'

890 views Asked by At

I imported the IQKeyboardManager from github via Firebase and it came with some swift 2.0 errors which were easy to fix, basically renaming a lot of things...

If you are using the current version of IQKeyboardManager for newest Swift, please help and let me know if you have gotten this error!

So now with the new version of IQKeyboardManager (3.2 viable), its showing me this error i just cant seem to figure out:

///////////problem here
let toolbar = textField.keyboardToolbar

// error says "Value of type 'UIView' has no 
// member 'keyboardToolbar' "

//  Setting toolbar to keyboard.
if let _textField = textField as? UITextField {

    //Bar style according to keyboard appearance
    switch _textField.keyboardAppearance {

    case UIKeyboardAppearance.dark:

        toolbar.barStyle = UIBarStyle.black
        toolbar.tintColor = UIColor.white
        toolbar.barTintColor = nil;
1

There are 1 answers

0
amirkrd On BEST ANSWER

Thanks for the comments, i checked all sources and it seems like upgrading from Swift 2 -> Swift 3 was not so friendly for all the third party libraries i was using in terms of syntax, so instead of recoding everything, the best idea was to uninstall the "IQKeyboardManagerSwift" from the Podfile and delete all its references inside the project, even the frameworks and then try to reinstall it with the updated version. The error was syntax based and it was pointing to some files that were not properly updated from the change to Swift 3....

Answer: Uninstall, delete references, and reinstall.

Thanks guys!