How to hide Toolbar in IQKeyboardManager iOS Swift 3

后端 未结 10 2161
南笙
南笙 2021-01-12 09:35

I\'m using the IQKeyboardManger library to scroll text fields when started typing using the keyboard, but I don\'t want to display the default toolbar from their library. Be

10条回答
  •  萌比男神i
    2021-01-12 09:58

    This is the way to do it for an individual view controller:

    class YourViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            IQKeyboardManager.shared.disabledToolbarClasses = [YourViewController.self]
        }
    }
    

    And to prevent the vc from rising when IQKeyboardManager raises it when the keyboard is present:

    IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(YourViewController.self)
    

提交回复
热议问题