A type-safe eventing library for iOS that replaces NSNotifications and delegates with an attach-and-forget observation pattern.
Signals is an eventing library for iOS that enables type-safe implementation of the Observable pattern. It replaces error-prone NSNotifications and cumbersome delegates with a system that ensures compile-time safety and reduces boilerplate code. The library allows objects to fire events and other objects to observe them with inline callbacks, automatically managing observer lifecycles.
iOS developers building applications in Objective-C or Swift who need a robust, type-safe alternative to NSNotifications or delegates for event communication between components.
Developers choose Signals for its compile-time type safety, which prevents common runtime crashes associated with NSNotifications, and its attach-and-forget observation that simplifies memory management. It offers a more declarative and less error-prone way to handle events compared to traditional iOS patterns.
Typeful eventing
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures data type mismatches are caught at compile time, preventing runtime crashes common with NSNotifications, as highlighted in the README's critique of NSNotification pitfalls.
Observers self-manage deallocation with attach-and-forget observation, reducing memory leak risks without manual de-registration, a key improvement over NSNotifications.
Supports one-time observation, custom callback queues, and firing previous data, allowing fine-tuned control for advanced use cases as demonstrated in the advanced usage section.
Backed by comprehensive unit test coverage noted in features, ensuring stability across diverse scenarios and reducing bug potential in event-driven code.
Swift usage requires creating concrete sub-classes with macros like CreateSignalInterface, adding boilerplate and complexity compared to native Swift eventing solutions, as admitted in the Swift support section.
Default max of 100 observers per signal can NSAssert in high-volume scenarios, forcing manual adjustments via maxObservers property, which adds overhead for legitimate use cases.
Primarily built for Objective-C with protocol-based signals, making it less idiomatic for modern Swift-first development and requiring extra steps for type safety in Swift.