No such Module IQKeyboardManagerSwift

浪尽此生 提交于 2019-12-10 21:59:24

问题


enter image description hereI am new to iOS Swift and trying to install this framework.

I have installed this framework by cocoa pods and add this line in app delegate

import IQKeyboardManagerSwift & IQKeyboardManager.sharedManager().enable = true

I am now getting this error (

No such Module IQKeyboardManagerSwift)

Can anyone please help me?


回答1:


First check the swift and Xcode version that you are using and if that version support the pod file you are using

Swift 2.2 (Xcode 7.3) Use:-

pod 'IQKeyboardManagerSwift'

Or

pod 'IQKeyboardManagerSwift', '4.0.3'

For Swift 2.1.1 (Xcode 7.2) Use :-

pod 'IQKeyboardManagerSwift', '4.0.0'

For Swift 2.0 (Xcode 7.0) Use :-

pod 'IQKeyboardManagerSwift', '3.3.3.1'

I had similar problem , turns out i had two Cocoapods instances installed, This is a Cocoapods issue not an Xcode one (in my case it was').

All i needed to do was uninstall my cocoapod and reinstall it https://stackoverflow.com/a/27940867/6297658...... This worked for me...

Once you are done reinstalling go to your pod file add pods according to the version of swift and Xcode you are using and then run pod install

PS: Cocoapods REPO is nearly 350MB, so if your download is stuck don't just quit Terminal and start reinstalling again first uninstall Cocoapods and old master repo both completely, then start installing again ... this is probably what caused two instances of it in my case




回答2:


Sometimes, when I install a new Pod, I need to clean & build the project.

Clean build folder: Alt+Shift+Cmd+K
Build: Cmd+B
Run: Cmd+R

Hope it helps




回答3:


It is issue when intsall through pods so drag and drop its file then wrtie this line in appDelegate didFinishLaunchingWithOptions method. IQKeyboardManager.sharedManager().enable = true




回答4:


In may case the following solution worked:

Replaced 'IQKeyboardManagerSwift' with 'IQKeyboardManager'



来源:https://stackoverflow.com/questions/38915896/no-such-module-iqkeyboardmanagerswift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!