12

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

IQKeyboardManager.sharedManager().enable = true

after pod update, the above code is not working.

Sheshnath
  • 3,293
  • 1
  • 32
  • 60
  • please check https://github.com/hackiftekhar/IQKeyboardManager and make sure add this line `IQKeyboardManager.sharedManager().enable = true` in `didFinishLaunchingWithOptions` – a.masri Apr 19 '18 at 09:30

3 Answers3

19

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
Krunal
  • 77,632
  • 48
  • 245
  • 261
2

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
}
0

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

Manish Mahajan
  • 2,062
  • 1
  • 13
  • 19