A drop-in-solution to present banner notifications in any UIViewController.
Use this pod to display multiple in app notifications in real time it, the source of the notifications doesn't matter, it can be from API or from scehduled events, it just works!.
This repository is maintained by the Duriana team at Duriana Internet.
![Objective-c](https://img.shields.io/badge/Language-Objective C-blue.svg?style=flat)
Minimum iOS Target: iOS 9.0
DUNotificationBanner
is available through CocoaPods, to install
it simply add the following line to your Podfile:
pod 'DUNotificationBanner'
// showing a banner in a UIViewController
// bannerView can be any UIView<DUNotificationBannerView>
[[DUNotificationBannerPresentationManager sharedManager] showBannerView:bannerView onViewController:self];
// hiding the a banner
[[DUNotificationBannerPresentationManager sharedManager] hideBannerView:bannerView];
In the demo project there is a class DurianaNotificationBannerView
which adds some neat functionalities like,
- Interaction callback
- Closing callback
- Closing timer
DurianaNotificationBannerView *bannerView = [[NSBundle.mainBundle loadNibNamed:@"DurianaNotificationBannerView" owner:nil options:nil] objectAtIndex:0];
bannerView.lifetime = arc4random_uniform(5);
bannerView.interactionBlock = ^{
NSLog(@"Interacted!");
};
bannerView.closeBlock = ^{
NSLog(@"Closed!");
};
[[DUNotificationBannerPresentationManager sharedManager] showBannerView:bannerView onViewController:self];
- Fix layout issues when using transparent navigation bar.
Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub.