NSViewController and Delegate

Hello,
I'm creating an app for Mac (not iPhone!) with XCode 14.2.
I have two NSViewController, VC1 and VC2.
VC1 sends data to VC2, which performs a search and must return the result. VC2 is created using a Modal segue.
I read several articles on Delegate to return data between ViewController, but all for UIViewController, none on NSViewController.
Any example of how to make VC2 return the data to VC1?
Thanks.

This forum is for topics related to swift language itself. Question about Apple frameworks like Cocoa / UIKit / SwiftUI should be discussed elsewhere (stackoverflow or apple dev forums). As a side note: Cocoa's NSViewController is very similar to UIKit's UIViewController and both are unrelated to SwiftUI.