首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOSDropDown:键入“UIResponder”没有成员“NSNotification”

iOSDropDown:键入“UIResponder”没有成员“NSNotification”
EN

Stack Overflow用户
提问于 2019-10-13 07:45:01
回答 1查看 836关注 0票数 1

在更新到Catalina和pod update之后,我得到一个错误

类型'UIResponder‘没有成员'NSNotification’

这是给iOSDropDown

代码语言:javascript
复制
if isSearchEnable && handleKeyboard{
        NotificationCenter.default.addObserver(forName: UIResponder.NSNotification.Name.UIKeyboardWillShow, object: nil, queue: nil) { (notification) in
            if self.isFirstResponder{
            let userInfo:NSDictionary = notification.userInfo! as NSDictionary
                let keyboardFrame:NSValue = userInfo.value(forKey: UIResponder.UIKeyboardFrameEndUserInfoKey) as! NSValue
            let keyboardRectangle = keyboardFrame.cgRectValue
            self.keyboardHeight = keyboardRectangle.height
                if !self.isSelected{
                    self.showList()
                }
            }

        }
        NotificationCenter.default.addObserver(forName: UIResponder.NSNotification.Name.UIKeyboardWillHide, object: nil, queue: nil) { (notification) in
            if self.isFirstResponder{
            self.keyboardHeight = 0
            }
        }
    }
EN

回答 1

Stack Overflow用户

发布于 2019-10-13 07:52:16

现在您将直接在UIResponder上使用UIResponder,如在Type Properties下提到的这里

代码语言:javascript
复制
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil)

注意:由于错误在外部库中,您可以在fork库中修复这个问题,并指向您的podfile中的分叉版本。或者,您可以选择在本地计算机上进行更改,但每次执行pod update时都会覆盖它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58361534

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档