Skip to content

Simple wrapper for NSNotificationCenter with closure

License

Notifications You must be signed in to change notification settings

charvoa/AGSwiftNotif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AGSwiftNotif

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod "AGSwiftNotif"

Usage

Post a notification

import AGSwiftNotif

let notification = AGSwiftNotif()
notification.postNotification("test")

Register for a notification

notification.registerObserver("test"){(notification:NSNotification!)->Void in
  // RECEIVE NOTIFICATION
}

Register for multiple notification

notification.registerObserver(["test","notifcation"]){(notification:NSNotification!)->Void in
  //CALLED WHEN ”test” or ”notification” is posted
}

Author

antoinegarcia, antoine.garcia@epitech.eu

License

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

About

Simple wrapper for NSNotificationCenter with closure

Resources

License

Stars

Watchers

Forks

Packages

No packages published