ios – IQKeyboardManager没有成员sharedManager

前端之家收集整理的这篇文章主要介绍了ios – IQKeyboardManager没有成员sharedManager前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用IQKeyboardManager pod,用于我的 swift 4.0项目.
IQKeyboardManager.sharedManager().enable = true

pod更新后,上面的代码无法正常工作.

解决方法

以下是您的问题的答案: Type ‘IQKeyboardManager’ has no member ‘sharedManager’ by hackiftekhar

自IQKeyboardManagerSwift版本6.0.0起,sharedManager()已被shared替换

对于pod’IQKeyboardManagerSwift’或pod’IQKeyboardManagerSwift’,’6.0.0′,试试这个:

IQKeyboardManager.shared.enable = true

看看这个:https://github.com/hackiftekhar/IQKeyboardManager/blob/master/IQKeyboardManagerSwift/IQKeyboardManager.swift

Swift Demo code by IQKeyboardManager

对于pod’IQKeyboardManagerSwift’,’5.0.0′,试试这个

IQKeyboardManager.sharedManager().enable = true
原文链接:https://www.f2er.com/iOS/332543.html

猜你在找的iOS相关文章