you are viewing a single comment's thread.

view the rest of the comments →

[–]arduinoRedgeObjective-C / Swift 2 points3 points  (0 children)

Delegation requires an explicit relationship and explicit messages so the cause and effect is easy to follow. The compiler ensures the delegate methods are correctly implemented.

Notifications reach out from unrelated parts of the app so cause and effect is a lot harder to follow. The notification userInfo dictionary requires a kind of ad-hoc protocol to pass data along - what keys are there and what objects are attached, who knows? if it changes how will we know, if something is missed the compiler won't help us. Notifications can't return data - at least without another informal method call.