I've been trying to understand how to use Cocoa Bindings. There seems to be three ways: key-value observing; Notifications; and Bindings in Interface Builder.
The purpose of bindings is supposedly to avoid writing lots of glue code and make it easy to transfer information between the model, the view and the controller -- but using Notifications and key-value observing seems to involve considerable amounts of code.
Setting bindings in Interface Builder would seem to be the simplest way, though to me the most oblique. Could someone talk me through, or point me to some useful information about how to use this? Essentially, whenever the user triggers an IBAction, it has to do view things and document things. (e.g. get view status info; alter document; reset view)
The View and Window objects only seems to offer Binding to the View Controller. So how do I bind the document to the View?
I've looked at Apple's documentation, and the RayWenderlich site tutorials.
Apart from a lack of code portability, is there really any reason why I shouldn't just define the relevant ViewController in the Document.swift file, and define the relevant Document in the ViewController.swift file, and then just call methods in each one?