'controlTextDidChange not triggered when NStextField text changes

I'm trying to hook to the text change event of an NSTextField.I have added the NSTextFieldDelegate ,set the delegate on the ViewDidLoad event.But this function is not triggered when I change the textfield.I'm using Swift 5,seems there is no need to override the controlTextDidChange like in Swift 4.What I'm I doing wrong ?

class ViewController: NSViewController, NSWindowDelegate,NSFontChanging,NSTextFieldDelegate{

@IBOutlet weak var text_watermark: NSTextField!

 override func viewDidLoad() {
        super.viewDidLoad()
        text_watermark.delegate=self
    }
  func controlTextDidChange(_ obj: Notification) {
    // Do stuff
   }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source