Chaining Events, Take One
In an execellent book on Domain-Driven Design that I’m reading in my spare time, they make a lot of use of domain events. I’ve written about a strongly typed publish–subscribe infrastructure in March already to get you started. Some of the book samples include what seems to be ad-hoc event subscribers. I try to port that to Swift.
Painless Event Delivery With a Custom Publish-Subscribe Infrastructure

In my apps, I have used a custom event delivery mechanism on top of NSNotificationCenter
with great success: I send a lot more events and consequently decouple parts of my code more easily. Putting your own objects around the Cocoa foundation can help use them more often. I want to show you how my EventPublisher
works, and why custom event types make me send a lot more events than when I only had NSNotification
s.