-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# iOSNotificationBanner | ||
|
||
This library allows you to show in-app notification. | ||
|
||
Features: | ||
- Enqueue unlimited notifications | ||
- Show any type of view as notification via custom Nib or view | ||
- Cancel enqueued notifications if needed | ||
|
||
# Example | ||
|
||
![Screenshot](http://i.imgur.com/gMe0xbo.png?2) | ||
|
||
####The singleton! | ||
|
||
```swift | ||
let notificationCenter = NotificationBannerCenter.defaultCenter | ||
``` | ||
|
||
####Enqueue Notification | ||
|
||
```swift | ||
num = 0 | ||
let chatNotificationView = ChatNotificationView.loadFromNib() | ||
chatNotificationView.nameLabel.text = "John Doe" | ||
chatNotificationView.messageLabel.text = "\(num) Hey, My name is John Doe!" | ||
chatNotificationView.thumbImageView.image = UIImage(named: "johndoe.jpg") | ||
chatNotificationView.context = "\(num)" | ||
chatNotificationView.tapClosure = { (nbView: NBView) in | ||
println((nbView as! ChatNotificationView).messageLabel.text) | ||
} | ||
notificationCenter.enQueueNotification(chatNotificationView) | ||
``` | ||
|
||
####Cancel Notification | ||
|
||
```swift | ||
let exampleContext = 0 | ||
notificationCenter.cancelNotificationsWithContexts(["\(exampleContext)"]) | ||
``` | ||
|
||
#Licenses | ||
|
||
MIT |