在更新到Catalina和pod update之后,我得到一个错误
类型'UIResponder‘没有成员'NSNotification’
这是给iOSDropDown的
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
}
}
}发布于 2019-10-13 07:52:16
现在您将直接在UIResponder上使用UIResponder,如在Type Properties下提到的这里,
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil)注意:由于错误在外部库中,您可以在fork库中修复这个问题,并指向您的podfile中的分叉版本。或者,您可以选择在本地计算机上进行更改,但每次执行pod update时都会覆盖它。
https://stackoverflow.com/questions/58361534
复制相似问题