Open Rupesh267 opened 2 years ago
Try it now FIxed
Hey use directly source but make this correction
if isSearchEnable && handleKeyboard{
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil) { (notification) in
if self.isFirstResponder{
let userInfo:NSDictionary = notification.userInfo! as NSDictionary
let keyboardFrame:NSValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue
let keyboardRectangle = keyboardFrame.cgRectValue
self.keyboardHeight = keyboardRectangle.height
if !self.isSelected{
self.showList()
}
}
}
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { (notification) in
if self.isFirstResponder{
self.keyboardHeight = 0
}
}
}