Skip to content

Commit 26856b4

Browse files
authored
Merge pull request #77 from Quantum2/master
Fix deprecated notification names
2 parents 1c4a70b + b488260 commit 26856b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

iOSDropDown/Classes/iOSDropDown.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ open class DropDown : UITextField{
143143
self.backgroundView.backgroundColor = .clear
144144
addGesture()
145145
if isSearchEnable && handleKeyboard{
146-
NotificationCenter.default.addObserver(forName: NSNotification.Name.UIKeyboardWillShow, object: nil, queue: nil) { (notification) in
146+
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil) { (notification) in
147147
if self.isFirstResponder{
148148
let userInfo:NSDictionary = notification.userInfo! as NSDictionary
149-
let keyboardFrame:NSValue = userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue
149+
let keyboardFrame:NSValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue
150150
let keyboardRectangle = keyboardFrame.cgRectValue
151151
self.keyboardHeight = keyboardRectangle.height
152152
if !self.isSelected{
@@ -155,7 +155,7 @@ open class DropDown : UITextField{
155155
}
156156

157157
}
158-
NotificationCenter.default.addObserver(forName: NSNotification.Name.UIKeyboardWillHide, object: nil, queue: nil) { (notification) in
158+
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { (notification) in
159159
if self.isFirstResponder{
160160
self.keyboardHeight = 0
161161
}

0 commit comments

Comments
 (0)