IQKeyboardManagerはとても便利なライブラリですが、他UIライブラリとの相性が悪く思い通りに動作しないことがあります。
MessageKitというライブラリを使用した際に、IQKeyboardManagerの機能が有効だったためUI周りの挙動がうまく制御できませんでした。そこでIQKeyboardManagerのdisabledDistanceHandlingClassesを使用し特定の画面のみライブラリの機能が無効になるよう設定しました。
AppDelegate didFinishLaunchingWithOptions()内に無効化する処理を追加する
IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(xxx.self)
func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(xxx.self)
return true
}
簡単に特定の画面のみIQKeyboardManagerの機能を無効化できました。
他UI系ライブラリとバッティングする場合は状況に応じて無効化すると良さそうです。
お粗末さまでした。