/NotificationManager

Make NSNotificationCenter suck less

Primary LanguageSwiftMIT LicenseMIT

NotificationManager

Build Status Version License Platform

NotificationManager is a block-based NSNotificationCenter wrapper, that deregisters automatically on deallocation.

Usage

Create one NotificationManager instance per object.

import NotificationManager 

class Foo {
  let notificationManager = NotificationManager()

  init() {
    notificationManager.registerObserver("BarNotification") { [unowned self] notification in
      // TODO: handle notification
    }
  }
}

Installation

NotificationManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "NotificationManager"

Author

Pod created by Tim Bodeit, tim@bodeit.com

Most of the credit goes to More indirection

License

NotificationManager is available under the MIT license. See the LICENSE file for more info.