Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IQKeyboardManager has no member sharedManager

i am using IQKeyboardManager pod, for my swift 4.0 project.

IQKeyboardManager.sharedManager().enable = true

after pod update, the above code is not working.

like image 785
Sheshnath Avatar asked Apr 19 '18 09:04

Sheshnath


2 Answers

Here is an answer to your question: Type 'IQKeyboardManager' has no member 'sharedManager' by hackiftekhar

Since IQKeyboardManagerSwift version 6.0.0, sharedManager() has been replaced with shared

For pod 'IQKeyboardManagerSwift' or pod 'IQKeyboardManagerSwift', '6.0.0', try this:

IQKeyboardManager.shared.enable = true

Look at this: https://github.com/hackiftekhar/IQKeyboardManager/blob/master/IQKeyboardManagerSwift/IQKeyboardManager.swift

enter image description here


Swift Demo code by IQKeyboardManager

enter image description here


For pod 'IQKeyboardManagerSwift', '5.0.0', try this

IQKeyboardManager.sharedManager().enable = true
like image 158
Krunal Avatar answered Nov 13 '22 01:11

Krunal


Use this code.it's perfectly working in swift4. install pod file .

pod 'IQKeyboardManager'

import IQKeyboardManager in AppDelegate

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    IQKeyboardManager.shared().isEnabled = true

    return true
}
like image 2
Vadlapalli Masthan Avatar answered Nov 13 '22 03:11

Vadlapalli Masthan