Type 'NSNotification.Name' has no member 'UITextField'
问题 With Swift 4.2, getting following error, that was working fine with Swift 4. Type 'NSNotification.Name' has no member 'UITextField' Here is my error code. NotificationCenter.default.addObserver(forName: NSNotification.Name.UITextField.textDidChangeNotification, object: textField, queue: OperationQueue.main) { (notification) in loginAction.isEnabled = textField.text != "" } Full Code: @IBAction func alertWithLogin(){ let alertController = UIAlertController(title: "Please Enter Credential",