iBanner is a customizable and lightweight library that makes the task of displaying in app notification banners in iOS
Basic Banners | Banners with different types |
---|---|
Growing Banners | Custom Banners |
---|---|
- Highly customizable ✅
- iPhone, iPhoneX, & iPad Support ✅
- Orientation change support ✅
- Custom
UIView
support ✅ - Support for long titles/ subtitles ✅
- Auto dismiss support ✅
- iOS 11.0+
- Xcode 11.0+
iBanner is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'iBanner'
To create a regular banner and show it, simply:
presentBanner(message: message)
To show a custom banner and to add any view into banner simply:
presentBanner() { banner in
//Load view from nib or create programmatically
guard let view = Bundle.main.loadNibNamed("CustomBanner", owner: self, options: nil)?.first as? UIView else { return }
banner.setContent(view)
}
To show different types of banner like:
- info
- warning
- error
- success
just need to update banner type in BannerConfigurations
BannerConfiguration.shared.bannerType = .info
BannerConfiguration.shared.bannerType = .warning
BannerConfiguration.shared.bannerType = .danger
BannerConfiguration.shared.bannerType = .success
To auto dismiss and dismiss delay simply:
BannerConfiguration.shared.autoDismiss = true
BannerConfiguration.shared.dismissDelay = 3.0