Skip to content

iBanner is a customizable and lightweight library that makes the task of displaying in app notification banners in iOS

Notifications You must be signed in to change notification settings

Aamirali86/iBanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iBanner

iBanner is a customizable and lightweight library that makes the task of displaying in app notification banners in iOS

Highly customizable

Basic Banners Banners with different types
Basic Banners Banners with Types
Growing Banners Custom Banners
Growing Banners Custom Banners

Features

  • Highly customizable ✅
  • iPhone, iPhoneX, & iPad Support ✅
  • Orientation change support ✅
  • Custom UIView support ✅
  • Support for long titles/ subtitles ✅
  • Auto dismiss support ✅

Requirements

  • iOS 11.0+
  • Xcode 11.0+

Installation

CocoaPods

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

pod 'iBanner'

Usage

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

About

iBanner is a customizable and lightweight library that makes the task of displaying in app notification banners in iOS

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published