Uber’s eventing framework
Uber’s Signals eventing framework allows you to develop event driven applications without the fragility inherent in using NSNotification objects or the boilerplate involved in using delegates.
When using NSNotification objects to send events to other objects, its usage is often error prone and causes unexpected app crashes. For example, on de-allocation, if a previously registered listener is not detached from the notification, the application could unexpectedly crash when the notification is fired.
Use Uber’s signals-ios framework to implement event-driven apps in a safe manner
- Type-safety - Each signal type created with the CreateSignalType macro creates a new protocol so the compiler can enforce type safety.
- Attach-and-forget observation - Signals takes care of the housekeeping needed to make event handling hassle-free and safe.
- Configurable observation behavior - Signals allows you to cancel a single observer. An observer can also be configured to cancel itself after responding to a signal once.
- Separate callback queues - Choose which operation queue to observe signals on, regardless of where they are fired from.
- Configurable maximum observer limit - By default, Signals framework limits the number of maximum observers to 100. This is to guard against unintended oversubscription due to inadvertent repeated registration.