更新为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
}
}
}
答案 0 :(得分:1)
您现在将直接在类型属性,
下的here上在keyboardWillShowNotification
上使用UIResponder
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil)
注意:由于该错误位于外部库中,因此您可以fork
修复该库,然后指向podfile
中的分叉版本。或者,您可以选择在本地计算机上进行更改,但是每次执行pod update
时,这些更改都会被覆盖。