I have one text field and one textView. The controlTextDidChange method responds to a text field change. But it doesn't respond to a textview change.
class AppDelegate: NSObject,NSApplicationDelegate,NSTextFieldDelegate,NSTextViewDelegate {
func applicationWillFinishLaunching(notification:NSNotification) {
/* delegates */
textField.delegate = self
textView.delegate = self
}
override func controlTextDidChange(notification:NSNotification?) {
if notification?.object as? NSTextField == textField {
print("good")
}
else if notification?.object as? NSTextView == textView {
print("nope")
}
}
}
I'm running Xcode 7.2.1 under Yosemite. Am I doing anything wrong?