Sheshnath
Sheshnath

Reputation: 3393

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.

Upvotes: 14

Views: 5763

Answers (3)

Krunal
Krunal

Reputation: 79676

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

Upvotes: 19

Manish Mahajan
Manish Mahajan

Reputation: 2082

It Works Perfect

Uncheck the Allow App Extensions API only for IQKeyboardManager Pod.

To get it Click on Pod -> IQkeyboardManager See Image below

enter image description here

Upvotes: 0

Vadlapalli Masthan
Vadlapalli Masthan

Reputation: 176

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
}

Upvotes: 4

Related Questions