@@ -101,7 +101,7 @@ class LaunchAppViewController: UIViewController, QRViewDelegate {
101101
102102 textField. layer. cornerRadius = 30
103103 if let placeHolderText = textField. placeholder {
104- textField. attributedPlaceholder = NSAttributedString ( string: placeHolderText, attributes: [ NSAttributedStringKey . foregroundColor: UIColor . lightGray] )
104+ textField. attributedPlaceholder = NSAttributedString ( string: placeHolderText, attributes: [ NSAttributedString . Key . foregroundColor: UIColor . lightGray] )
105105 }
106106 }
107107
@@ -163,22 +163,22 @@ extension LaunchAppViewController {
163163 }
164164
165165 private func registerNotificationObservers( ) {
166- NotificationCenter . default. addObserver ( self , selector: #selector( keyboardWillShow) , name: . UIKeyboardWillShow , object: nil )
167- NotificationCenter . default. addObserver ( self , selector: #selector( keyboardWillHide) , name: . UIKeyboardWillHide , object: nil )
168- NotificationCenter . default. addObserver ( self , selector: #selector( deviceRotated) , name: . UIDeviceOrientationDidChange , object: nil )
166+ NotificationCenter . default. addObserver ( self , selector: #selector( keyboardWillShow) , name: UIResponder . keyboardWillShowNotification , object: nil )
167+ NotificationCenter . default. addObserver ( self , selector: #selector( keyboardWillHide) , name: UIResponder . keyboardWillHideNotification , object: nil )
168+ NotificationCenter . default. addObserver ( self , selector: #selector( deviceRotated) , name: UIDevice . orientationDidChangeNotification , object: nil )
169169 }
170170
171171 private func unregisterNotificationObservers( ) {
172- NotificationCenter . default. removeObserver ( self , name: . UIKeyboardWillShow , object: nil )
173- NotificationCenter . default. removeObserver ( self , name: . UIKeyboardWillHide , object: nil )
174- NotificationCenter . default. removeObserver ( self , name: . UIDeviceOrientationDidChange , object: self )
172+ NotificationCenter . default. removeObserver ( self , name: UIResponder . keyboardWillShowNotification , object: nil )
173+ NotificationCenter . default. removeObserver ( self , name: UIResponder . keyboardWillHideNotification , object: nil )
174+ NotificationCenter . default. removeObserver ( self , name: UIDevice . orientationDidChangeNotification , object: nil )
175175 }
176176
177177 @objc func keyboardWillShow( _ notification: Notification ) {
178178 keyboardShowTask? . cancel ( )
179179 keyboardShowTask = DispatchWorkItem {
180- if let keyboardRect = notification. userInfo ? [ UIKeyboardFrameEndUserInfoKey ] as? CGRect {
181- let duration = notification. userInfo ? [ UIKeyboardAnimationDurationUserInfoKey ] as? Double
180+ if let keyboardRect = notification. userInfo ? [ UIResponder . keyboardFrameEndUserInfoKey ] as? CGRect {
181+ let duration = notification. userInfo ? [ UIResponder . keyboardAnimationDurationUserInfoKey ] as? Double
182182 self . view. frame. size. height = UIScreen . main. bounds. height - keyboardRect. height
183183 self . qrView. stopScanning ( )
184184 self . qrView. layer. opacity = 0
@@ -191,7 +191,7 @@ extension LaunchAppViewController {
191191 }
192192
193193 @objc func keyboardWillHide( _ notification: Notification ) {
194- let duration = notification. userInfo ? [ UIKeyboardAnimationDurationUserInfoKey ] as? Double
194+ let duration = notification. userInfo ? [ UIResponder . keyboardAnimationDurationUserInfoKey ] as? Double
195195 view. frame. size. height = UIScreen . main. bounds. height
196196 self . qrView. startScanning ( )
197197 self . qrView. layer. opacity = 1
0 commit comments