Swift 3 NSNotificationCenter Keyboardwillshow/hide

后端 未结 4 648
栀梦
栀梦 2020-12-06 17:27

I have a piece of code that worked in Swift 2 and I tried using Xcode to update the code to the newest version and I fixed everything except two issues.

I have this

4条回答
  •  广开言路
    2020-12-06 18:11

    NSNotificationCenter have things alter for get show keyboard:

    NotificationCenter.default.addObserver(self, selector: #selector(NovaVisitaVC.abreTeclado(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
    
    NotificationCenter.default.addObserver(self, selector: #selector(NovaVisitaVC.abreTeclado(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
    

提交回复
热议问题