What is the analogous method for the function `searchBar(_ searchBar: UISearchBar, textDidChange searchText: String)` in macOS? 

Got the answer:

```
 @IBOutlet weak var searchBar: NSSearchField!
  func controlTextDidChange(_ obj: Notification){
    let searchObject:NSSearchField? = obj.object as? NSSearchField
    if searchObject==self.searchBar{

    }
}

```