The easiest way to display highly customizable in app notification banners in iOS
• Swift 4.2 Support 🎉 🎉 🎉 Thanks @spadafiva! • Can now remove banners from the banner queue. Thanks @mixo44! • Better notch support handling for iPhones. Thanks @joseantoniogarciay!
• Fixed a bug causing notification banners not to auto rotate correctly if their bannerPosition
was .bottom
. Thanks @valexa! 👍 👍 👍
By default, each notification banner is placed onto a singleton of an auto-managed NotificationBannerQueue. This allows an infinite amount of banners to be displayed without one hiding the other. If you have multiple controllers within your navigation stack that need to be managed by a seperate queue (like a tab bar controller), simply create an instance of a NotificationBannerQueue and pass it in to the show function:
banner.show(queue: customQueue)
Thanks to @t4ec for the feature request! 👍 👍 👍
• StatusBarNotificationBanner
's are now 50px tall on iPhone X by default. Thanks @btelintelo! 👍
• Fixed a bug causing notification banners not to appear correctly on iPhone X's if the navigation bar was hidden. Thanks @pikachu987! 👍 🎉
• iPhoneX is now supported
Closes #49 🎉 Thanks @JoniVR! 👍
The following banner related notifications will be posted to NotificationCenter:
BannerNotification.BannerWillAppear
BannerNotification.BannerDidAppear
BannerNotification.BannerWillDisappear
BannerNotification.BannerDidDisappear
The banner object can be retrieved from the notification as follows:
func onBannerNotification(notification: Notification) {
guard let banner = notification.userInfo?[NotificationBanner.BannerObjectKey] as? BaseNotificationBanner else {
return
}
// Do something with the banner
}
• Can now remove all banners from the NotificationBannerQueue by calling NotificationBannerQueue .default.removeAll()
Closes #44 🎉 Thanks @ashokkumars! 👍
Changes:
If you are wanting to show a banner from the bottom, simply:
banner.show(bannerPosition: .bottom)
All existing properties that the show function takes can be mixed and matched to work flawlessly with each other! Closes #31 🎉 Thanks @scottcc! 👍
You can choose to opt into a notification banner's events by registering as its delegate:
banner.delegate = self
Then just make sure to implement the following methods:
internal func notificationBannerWillAppear(_ banner: BaseNotificationBanner)
internal func notificationBannerDidAppear(_ banner: BaseNotificationBanner)
internal func notificationBannerWillDisappear(_ banner: BaseNotificationBanner)
internal func notificationBannerDidDisappear(_ banner: BaseNotificationBanner)
Closes #32 🎉 Thanks @Marlon-Monroy! 👍
New CocoaPods Release: v1.4.0 ✅