It was a fun weekend with a tonne of content packed in to 2 days. Here are a few of my notes from the course.
- Controller interacts with model.
- Controller interacts with view.
- Controller/View interaction occurs through the use of protocols and delegates.
- .h -> header file that defines public interface of object
- .m -> implementation file. this file defines the public and non public functions.
Protocols and Delegates
- Controller assigns itself as the view’s delegate.
- View can only have a single delegate.
- View forwards screen interactions to it’s delegate.
- the protocol is the contract that the controller must implement in order to receive calls of specific screen interactions.
- the view has no intimate knowledge of its delegate, only the contract (protocol) defined between it and its delegate.
- protocols are used to achieve polymorphic behaviour.
- allows for non-blocking calls. interesting asynchronous programming model.
Notifications (event aggregator)
- NSNotifications can go to any number of subscribers.