I’ve mentioned a few libraries for simplifying work with NSNotificationCenter, most recently FXNotifications which provides an objective-c category adding a blocks based API and reducing memory related issues.
Here’s an open source library from Alec Larson providing a Swift based alternative to NSNotificationCenter with a very clean and simple syntax.
This example from the readme shows how simple it is to create a generic emitter with EmitterKit:
didLogin.once { user in
println("Successfully logged in as (user.name)!")
}
didLogin.emit(user)
The advantages of EmitterKit as stated in the readme include:
– No longer be forced to typecast event data in your closures.
– No longer be forced to removeObserver in your classes’ deinit methods.
– Backwards-compatible with NSNotificationCenter (like UIKeyboardWillShowNotification)!
– Simpler syntax
You can find Emitter-Kit on Github here.
A nice easy to use swift based library for working with NSNotificationCenter.
- Library Providing An NSNotificationCenter Alternative For Handling Multiple Delegates
- NSNotificationCenter Category Providing An Easier Blocks Based API Without The Memory Issues
- Libraries For Easier Drawing Of Custom UI Elements, CoreImage Filter Enhancements And More
- Extensive Swift Utility Library Inspired By Python’s Standard Library
- Open Source Library Extending Swift Strings With Linguistics And Social Features
Original article: Open Source Library Providing A Swift Based Alternative To NSNotificationCenter
©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.




