The easiest way to display highly customizable in app notification banners in iOS

Overview

Notification Banner

Version Platform Language: Swift License

Written in Swift 5

NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banners and drop down alerts an absolute breeze in iOS.

Basic Banners Banners with Side Views Status Bar Banners
Basic Banners Banners with Side Views Status Bar Banners
Growing Banners Floating Banners Stacked Banners
Growing Banners Floating Banners Floating Banners

Features

  • Highly customizable
  • NSAttributedString support
  • iPhone, iPhoneX, & iPad Support
  • Orientation change support
  • Custom UIView support
  • Custom colors support
  • Support for long titles/ subtitles
    • NotificationBanner uses horizontal scrolling labels
    • GrowingNotificationBanner grows in height as needed
  • Presenting from top or bottom support
  • Haptic feeback support
  • Built in banner queue
  • Allow to display several banners simultaneously, configurable in banners queue
  • Accessibility support

Requirements

  • iOS 10.0+
  • Xcode 10.0+

Installation

CocoaPods

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

Swift 5 + Xcode 11 + iOS 13 Support

pod 'NotificationBannerSwift', '~> 3.0.0'

Swift 5 + Xcode 10.x

pod 'NotificationBannerSwift', '2.5.0'

Swift 4.2

pod 'NotificationBannerSwift', '2.0.1'

Swift 4.0

pod 'NotificationBannerSwift', '1.6.3'
pod 'MarqueeLabel/Swift', '3.1.6'

Then add import NotificationBannerSwift at the top of each file you use NotificationBanner in your project.

Carthage

To use NotificationBanner via Carthage simply add this line to your Cartfile:

Swift 5

github "Daltron/NotificationBanner" "master"

Then add NotificationBanner.framework and the dependencies SnapKit.framework and MarqueeLabel.framework in your project.

Usage

Creating drop down alerts with NotificationBanner is easy. To create a regular banner (with scrolling labels) and show it, simply:

let banner = NotificationBanner(title: title, subtitle: subtitle, style: .success)
banner.show()

If you want to create a banner which grows in height as needed and show it accordingly just use GrowingNotificationBanner instead of NotificationBanner:

let banner = GrowingNotificationBanner(title: title, subtitle: subtitle, style: .success)
banner.show()

To create a status bar alert, simply:

let banner = StatusBarNotificationBanner(title: title, style: .success)
banner.show()

By default, each banner will be displayed on the main application window. If you are wanting to show a banner below a navigation bar, simply show on the view controller that is within the navigation system:

banner.show(on: viewController)

By default, each banner will present from the top. If you are wanting to display from the bottom, simply:

banner.show(bannerPosition: .bottom)

Each of the show properties defined above can be mixed and matched to work flawlessly with eachother.

By default, each banner will automatically dismiss after 5 seconds. To dismiss programatically, simply:

banner.dismiss()

To show a banner infinitely until it is manually dismissed, simply:

banner.autoDismiss = false

NotificationBanner has five prebuilt styles that you can choose from:

public enum BannerStyle {
    case danger
    case info
    case customView
    case success
    case warning
}

You can override the predefined colors that NotificationBanner uses for any style by conforming to the BannerColorsProtocol:

public protocol BannerColorsProtocol {
    func color(for style: BannerStyle) -> UIColor
}

Its as easy as creating a custom banner colors class:

class CustomBannerColors: BannerColorsProtocol {

    internal func color(for style: BannerStyle) -> UIColor {
        switch style {
            case .danger:	// Your custom .danger color
            case .info:		// Your custom .info color
            case .customView:	// Your custom .customView color
            case .success:	// Your custom .success color
            case .warning:	// Your custom .warning color
        }
    }

}

And then passing in that class to any notification banner you create:

let banner = NotificationBanner(title: title, style: .success, colors: CustomBannerColors())
banner.show()

By default, the .info style will be applied to the banner if no style is provided in the init method. You can set the background color of a banner at any time by simply setting the backgroundColor.

Banners with Side Views

A notification banner can have a left accessory view, a right accessory view, or both:

// Success Style Notification with Left View
let leftView = UIImageView(image: #imageLiteral(resourceName: "success"))
let banner = NotificationBanner(title: title, subtitle: subtitle, leftView: leftView, style: .success)
banner.show()

 // Danger Style Notification with Right View
let rightView = UIImageView(image: #imageLiteral(resourceName: "danger"))
let banner = NotificationBanner(title: title, subtitle: subtitle, rightView: rightView, style: .danger)
banner.show()    

// Info Style Notification with Left and Right Views
let leftView = UIImageView(image: #imageLiteral(resourceName: "info"))
let rightView = UIImageView(image: #imageLiteral(resourceName: "right_chevron"))
let banner = NotificationBanner(title: title, subtitle: subtitle, leftView: leftView, rightView: rightView, style: .info)
banner.show()

Banners with Side Views

Each side view will be automically reisized to fit perfectly

Banners with a Custom View

A notification banner can also be initalized with a custom view:

let banner = NotificationBanner(customView: NorthCarolinaBannerView())
banner.show()

Custom Banner

Handling User Interaction

By default, when a banner is tapped or swiped up by a user, it will be dismissed. If you want to detect when the user taps or swipes up on a banner, simply:

banner.onTap = {
	// Do something regarding the banner
}
banner.onSwipeUp = {
	// Do something regarding the banner
}

Banner Events

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:

func notificationBannerWillAppear(_ banner: BaseNotificationBanner)
func notificationBannerDidAppear(_ banner: BaseNotificationBanner)
func notificationBannerWillDisappear(_ banner: BaseNotificationBanner)
func notificationBannerDidDisappear(_ banner: BaseNotificationBanner)

Haptic Feedback Support

By default, when a banner is displayed, a haptic feedback will be generated on devices that support it. The types of haptic feedback are as follows:

public enum BannerHaptic {
	case light
   	case medium
	case heavy
  	case none
}

To change the type of haptic feedback to generate when a banner is shown, simply:

banner.haptic = .heavy

Banner Queue

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)

By default, each notification banner is placed on the back of the queue. If you would rather place the banner in the front and show it immediately no matter how many banners are in the queue, simply state it in the show() method:

banner.show(queuePosition: .front)

Adding a banner to the front of the queue will temporarily suspend the currently displayed banner (if there is one) and will resume it after the banner in front of it dismisses.

To get the number of banners currently on the queue, simply:

let numberOfBanners = NotificationBannerQueue.default.numberOfBanners

This is all automatically managed!

Banner Queue and display banners simultaneously (stacked)

You can also create the queue to display several banners at once with controlling of maximum number of banners to be displayed simultaneously. You can "show" more banners than allowed by queue settings - banners what exceed this value will be displayed some time later, after some banners already displayed on screen will be closed. In example below we create queue with maximum simultaneous banners allowed - 3:

let bannerQueueToDisplaySeveralBanners = NotificationBannerQueue(maxBannersOnScreenSimultaneously: 3)

Create five different banners:

let banner1 = FloatingNotificationBanner(
	title: "Success Notification - 1",
	subtitle: "First Notification from 5 in current queue with 3 banners allowed simultaneously",
	style: .success
)
banner1.delegate = self

let banner2 = FloatingNotificationBanner(
	title: "Danger Notification - 2",
	subtitle: "Second Notification from 5 in current queue with 3 banners allowed simultaneously",
	style: .danger
)
banner2.delegate = self

let banner3 = FloatingNotificationBanner(
	title: "Info Notification - 3",
	subtitle: "Third Notification from 5 in current queue with 3 banners allowed simultaneously",
	style: .info
)
banner3.delegate = self

let banner4 = FloatingNotificationBanner(
	title: "Success Notification - 4",
	subtitle: "Fourth Notification from 5 in current queue with 3 banners allowed simultaneously",
	style: .success
)
banner4.delegate = self

let banner5 = FloatingNotificationBanner(
	title: "Info Notification - 5",
	subtitle: "Fifth Notification from 5 in current queue with 3 banners allowed simultaneously",
	style: .info
)
banner5.delegate = self

and show all five banners at once:

showBanners(
	[banner1, banner2, banner3, banner4, banner5],
	in: bannerQueue5AllowedMixed
)

using this supporting method

func showBanners(
	_ banners: [FloatingNotificationBanner],
	in notificationBannerQueue: NotificationBannerQueue
) {
    banners.forEach { banner in
      	banner.show(
	      	bannerPosition: selectedBannerPosition(),
		 	queue: notificationBannerQueue,
		 	cornerRadius: 8,
			shadowColor: UIColor(red: 0.431, green: 0.459, blue: 0.494, alpha: 1),
		  	shadowBlurRadius: 16,
			shadowEdgeInsets: UIEdgeInsets(top: 8, left: 8, bottom: 0, right: 8)
	   )
    }
}

It will display first three banners at once, and after some time (or by user tap) it will be hidden and 4 and 5 banner will be displayed when. All it with fancy animation.

Feature Requests

I'd love to know anything that you think NotificationBanner is missing. Open an issue and I'll add the feature request label to it and I'll do everything I can to accomodate that request if it is in the library's best interest. 😄

Apps that Use NotificationBanner

Q - Talk About Music VH Dispatch Stikkr CardCast Happy Scale Wanderings Modern Magic 8 Ball Envision: Habits Tracker TSUM RIS LukaPizza

Feel free to add yours!

Author

Dalton Hinterscher, [email protected]

License

NotificationBanner is available under the MIT license. See the LICENSE file for more info.

Comments
  • Stop building on latest

    Stop building on latest

    It is giving me compilation error for MarqueeLabel 3.2.0, I have not ported my code to 4.2, even using older version of NotificationBanner is giving MarqueeLabel 3.2.0, which is giving me compilation error.

    opened by goeltarun 21
  • StatusNotificationBanner is behind the status bar

    StatusNotificationBanner is behind the status bar

    Hello I'm trying to display a StatusNotificationBanner when a match in my application is cancelled, but I think I am making something wrong because this is what happens after a few seconds of the notification being displayed

    behind

    This is how I am making the call

    MyService.instance.cancelRunningMatch { (success) in
                if success {
                    let banner = StatusBarNotificationBanner(title: "Match successfully cancelled", style: .success)
                    banner.show()
                    self.navigationController?.popViewController(animated: true)
                } else {
                   print("error when trying to cancel match")
                }
                self.cancelBtn.isEnabled = true
            }
    

    Could you please help me? thanks in advance! Edit: It happens on the simulator (iPhone 7) and on a iPhone 6, but cannot replicate on an iPhone 8

    wontfix 
    opened by jeop10 16
  • [GEN] Fix crash when bannerPositionFrame == nil

    [GEN] Fix crash when bannerPositionFrame == nil

    We happened to root caused this issue when the notification was sent after the app became inactive.

    We did some code to send the notification, and this part of code was triggered when app become inactive. This causes crash every time, the root cause is bannerPositionFrame is nil.

    opened by niltsh 15
  • setting custom colors for the default banner styles

    setting custom colors for the default banner styles

    Hey, awesome library. I was looking through it and thought it would be cool to be able to set your own colors for the default Banner Styles outside of setting the background color directly. Here is a stab at making that possible.

    opened by ahartwel 11
  • NotificationBanner Pod not updated for Swift 4.2

    NotificationBanner Pod not updated for Swift 4.2

    Hi,

    I have installed NotificationBanner through Cocoapods and when I build my project, I have the following errors:

    screen shot 2018-11-09 at 9 47 49 am

    Pod install

    pod install
    Analyzing dependencies
    Fetching podspec for `Sensa-Model` from `../../Sensa-Model`
    Fetching podspec for `Sensa-Network` from `../`
    Fetching podspec for `Sensa-Stylesheet` from `../../Sensa-Stylesheet`
    Downloading dependencies
    Using Alamofire (4.7.3)
    Using AsyncSwift (2.0.4)
    Using Freddy (3.0.3)
    Using MarqueeLabel (3.2.0)
    Using Moya (10.0.2)
    Using Nimble (7.3.1)
    Using NotificationBannerSwift (1.8.0)
    Using ObjcExceptionBridging (1.0.1)
    Using Quick (1.3.2)
    Using ReachabilitySwift (4.3.0)
    Using Realm (3.11.1)
    Using RealmSwift (3.11.1)
    Using Result (3.2.4)
    Using Sensa-Model (1.0.46)
    Installing Sensa-Network 1.0.18
    Using Sensa-Stylesheet (1.0.6)
    Using SnapKit (4.0.1)
    Using SwiftMsgPack (1.0.0)
    Using XCGLogger (6.1.0)
    Generating Pods project
    libs NotificationBannerSwift to Swift 3.2
    libs NotificationBannerSwift to Swift 3.2
    Integrating client project
    Sending stats
    Pod installation complete! There are 5 dependencies from the Podfile and 19 total pods installed.
    

    Stack

       CocoaPods : 1.5.3
       Ruby : ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
       RubyGems : 2.7.4
       Host : Mac OS X 10.13.6 (17G65)
       Xcode : 10.1 (10B61)
       Git : git version 2.17.2 (Apple Git-113)
       Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
    
    wontfix 
    opened by YMonnier 10
  • Fatal error with: bannerPositionFrame.startFrame

    Fatal error with: bannerPositionFrame.startFrame

    When I try to display the notification on a real device it shows that error:

    Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

    On this line:

    self.frame = bannerPositionFrame.startFrame

    Help please.

    wontfix 
    opened by EdwinJr13 9
  • Carthage update failed

    Carthage update failed

    xcode 9 macOS 10.12

    error log:

    mypath/Carthage/Checkouts/NotificationBanner/NotificationBanner/Classes/StatusBarNotificationBanner.swift:49:68: error: type 'UIFont' has no member 'Weight'
            titleLabel!.font = UIFont.systemFont(ofSize: 12.5, weight: UIFont.Weight.bold)
                                                                       ^~~~~~ ~~~~~~
    UIKit.UIFont:46:14: note: did you mean 'xHeight'?
        open var xHeight: CGFloat { get }
                 ^
    mypath/Carthage/Checkouts/NotificationBanner/NotificationBanner/Classes/NotificationBanner.swift:90:68: error: type 'UIFont' has no member 'Weight'
            titleLabel!.font = UIFont.systemFont(ofSize: 17.5, weight: UIFont.Weight.bold)
                                                                       ^~~~~~ ~~~~~~
    UIKit.UIFont:46:14: note: did you mean 'xHeight'?
        open var xHeight: CGFloat { get }
                 ^
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
    	CompileSwift normal arm64
    (2 failures)
    
    opened by tentenlee100 9
  • Unexpectedly found nil when setting up banner

    Unexpectedly found nil when setting up banner

    Hello,

    I am using Reachability with your NotificationBanner. For example, when there is no internet, I am displaying a status bar notification saying "No Internet Connection". I am facing this very odd bug.

    At the top of my ViewController I declare a variable

    var isBannerShown = false
    var banner: StatusBarNotificationBanner?
    

    I also have a function that fires when reachability changes. It will go off when you go from online -> offline and vice versa.

        func reachabilityChanged(note: Notification) {
            if banner == nil {
                banner = StatusBarNotificationBanner(title: "No Internet Connection")
                banner?.autoDismiss = false
            }
            let reachability = note.object as! Reachability
            switch reachability.connection {
                case .none:
                    isBannerShown = true
                    banner?.show(queuePosition: .front, on: self)
                    self.isNetworkDown = true
                    self.sectionIndexes = [:]
                    self.tableViewIndexController.tableViewIndex.reloadData()
                    self.searchBar.isUserInteractionEnabled = false
                    self.sections = []
                case .cellular, .wifi:
                    if isBannerShown {
                        print("Banner is currently displayed")
                        banner?.dismiss()
                        isBannerShown = false
                    }
                    sections = createSections()
            }
        }
    

    This type of behavior is causing the banner to crash. I have no idea why. When I go and comment out

    bannerPositionFrame = BannerPositionFrame(bannerPosition: bannerPosition,
                                                      bannerWidth: appWindow.frame.width,
                                                      bannerHeight: bannerHeight,
                                                      maxY: maximumYPosition())
    

    everything works as normal. The app I am working on doesn't deal with different orientations. It is always in vertical mode.

    Any suggestions on why this is happening?

    screen shot 2017-09-24 at 2 44 09 pm
    opened by AAAstorga 9
  • Floating banner is not working

    Floating banner is not working

    Hi! I just discovered this beautiful package and tried this:

    let banner = FloatingNotificationBanner(title: "...", subtitle: "....", style: .info)
    banner.haptic = .medium
    
    banner.show()
    

    but the banner style shows like the default, not in a floating view, am I doing something wrong?

    I'm using XCode 13, swift 5.5, swiftui 3.0

    Thanks

    wontfix 
    opened by afern247 8
  • iOS 13 StatusBarNotificationBanner behind status bar

    iOS 13 StatusBarNotificationBanner behind status bar

    It seems like iOS 13 when showing a StatusBarNotificationBanner it appears behind the status bar when i'd expect it to be on top. Working fine on iOS 12 in the Simulator.

    wontfix 
    opened by SRowley90 8
  • Banner isn't showing in 3.0.0

    Banner isn't showing in 3.0.0

    Replacing

    private let appWindow: UIWindow? = {
        if #available(iOS 13.0, *) {
            return UIApplication.shared.connectedScenes
                .first { $0.activationState == .foregroundActive }
                .map { $0 as? UIWindowScene }
                .map { $0?.windows.first } ?? UIApplication.shared.delegate?.window ?? nil
        }
    
        return UIApplication.shared.delegate?.window ?? nil
    }()
    

    with

    private let appWindow: UIWindow? = {
       return UIApplication.shared.keyWindow
    }()
    

    solved the problem.

    wontfix 
    opened by carmelogallo 8
  • Make every type work with dynamic island

    Make every type work with dynamic island

    This PR solves the issue with the banners ending up behind the dynamic island. I have tried all on iPhone 14 Pro and Max and also tried it on iPhone 14 to make sure nothing broke.

    Things to note:

    • Not sure the hasDynamicIsland logic is correct. It worked on the different simulators I tried.
    • Not sure I have manipulated the height and the margins in the right place. Maybe there is a better way to do it.
    • Not sure the numbers are perfect. Could be some more padding for certain types but not very knowledgable about the project to make it work perfect for all.

    Fixes #394

    opened by materik 1
  • Main Thread crash

    Main Thread crash

    Once you trigger the notifications multiple times, the app crashes. Here are some screenshot of where the error is occurring:

    image

    image

    image

    This happens once you activate the notification in an async function that takes some time to execute, for example, fetching some data. It doesn't matter if you put it into a DispatchQueue.main.async { }, it still crashes

    opened by afern247 0
  • StatusBarNotificationBanner onTap not working

    StatusBarNotificationBanner onTap not working

    I am trying to perform some action after a StatusBarNotificationBanner was tapped. Unfortunately onTap is not triggered.

    If I increase the banner height, taps are registered but only up to the statusbar but not in the status bar area. It this expected behavior or is this a bug?

    banner.dismissOnSwipeUp = false
    banner.dismissOnTap = true
    banner.autoDismiss = false
    banner.bannerHeight = 200
    banner.isUserInteractionEnabled = true
    banner.onTap = {
        print("Hello World")
    }
    banner.show()
    
    opened by mufumade 0
  • Banner style extension

    Banner style extension

    It would be great if we have the opportunity to change not only a banner background. In my project, I need to control the corner radius, border width and border colour. I can make these changes myself and create a pull request for you. Just give me some recommendations about how you see that feature in your framework.

    opened by ftp27 0
Releases(3.1.0)
  • 3.0.6(Jan 21, 2021)

  • 3.0.0(Oct 8, 2019)

    Official iOS 13 Support and Stacked Banners 🎉 🎉🎉

    • Fixed issue on all banner types where the banner would be covered up by the status bar on all non notch devices. It appears the status bar can no longer be directly hidden in iOS 13 anymore.

    • A huge shoutout to all who who contributed to iOS 13 support

    • @ashleyevans
    • @igorkulman
    • @rolandkakonyi

    • An even larger shoutout to @mrsnow-git who implemented stacked banners! 👍 👍

    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Jul 17, 2019)

    • FloatingNotificationBanner's now support custom views • All notification banners now have a transparency property that can be changed to give them a new sleek look

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Jan 2, 2019)

    Changes

    • Added a new banner type FloatGrowingNotificationBanner. (Huge thanks to @mrsnow-git! 👍 👍 👍 ) • Added a function to reset a banner's elapsed duration to zero. (Thanks @ecastillo! 👍)
    • Fixed an issue within the NotificationBannerUtilities class. (Thanks @Lausbert! 👍)
    • Updated podspec to use SnapKit 4.2.0. (Thanks @anelad! 👍)

    Source code(tar.gz)
    Source code(zip)
  • 1.8.0(Oct 30, 2018)

  • 1.7.0(Sep 19, 2018)

    • Swift 4.2 Support 🎉 🎉 🎉 Thanks @spadafiva! • Can now remove banners from the banner queue. Thanks @mixo44! • Better notch support handling for iPhones. Thanks @joseantoniogarciay!

    Source code(tar.gz)
    Source code(zip)
  • 1.6.1(Jan 25, 2018)

    • Fixed a bug causing notification banners not to auto rotate correctly if their bannerPosition was .bottom. Thanks @valexa! 👍 👍 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.6.0(Jan 25, 2018)

    Multiple Banner Queue Support

    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! 👍 👍 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.5.4(Jan 8, 2018)

  • 1.5.3(Dec 19, 2017)

    • Fixed a bug causing notification banners not to appear correctly on iPhone X's if the navigation bar was hidden. Thanks @pikachu987! 👍 🎉

    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Sep 24, 2017)

  • 1.4.4(Sep 19, 2017)

  • 1.4.2(Aug 7, 2017)

    NotificationCenter Notifications

    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
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 1.4.1(Aug 3, 2017)

    • Can now remove all banners from the NotificationBannerQueue by calling NotificationBannerQueue .default.removeAll()

    Closes #44 🎉 Thanks @ashokkumars! 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Jun 25, 2017)

    Changes:

    Banners can now be shown from the bottom

    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! 👍

    Banner Events

    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 ✅

    Source code(tar.gz)
    Source code(zip)
  • 1.3.3(Jun 21, 2017)

    Fixes an issue where an array out of bounds exception would occur when a banner is dismissed if it wasn't placed on the NotificationBannerQueue

    Thanks @shanev! 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.3.2(Jun 13, 2017)

    Changes:

    BannerColorsproperty added to banners initialized with attributed text.

    Thanks @harmjanr! 👍

    Fixed an issue causing banners with long titles not to scroll properly.

    A huge thanks to @cbpowell for working closely with me to address this! 👍 Thanks @egenvall for first reporting the issue! 👍 Closes #10 🎉

    New CocoaPods Release: v1.3.2 ✅

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Jun 8, 2017)

    Changes:

    Banners can now be shown underneath a navigation bar

    If you are wanting to show a banner below a navigation bar, simply show on the view controller that is within the navigation system:

    banner.show(on: viewController)
    

    Closes #16 🎉

    Banners can now be shown infinitely until they are manually dismissed

    To show a banner infinitely until it is manually dismissed, simply:

    banner.autoDimiss = false
    

    Closes #19 🎉

    Haptic Feedback support

    By default, when a banner is displayed, a haptic feedback will be generated on devices that support it. The types of haptic feedback are as follows:

    public enum BannerHaptic {
        case light
        case medium
        case heavy
        case none
    }
    

    To change the type of haptic feedback to generate when a banner is shown, simply:

    banner.haptic = .heavy
    

    Closes #15 🎉

    New CocoaPods Release: v1.3.0 ✅ Thanks @nick-iCars! 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(May 6, 2017)

    Changes:

    • NotificationBanner's now have a isDisplaying boolean property which will tell you wether or not the banner is currently being displayed.

    • The NotificationBannerQueue is now a public class that can be accessed via:

    let bannerQueue = NotificationBannerQueue.default
    

    As of right now, the only thing that can be obtained from the banner queue is a property called numberOfBanners which tells you how many notification banners are currently on the queue.

    New CocoaPods Release: v1.2.0 ✅ Closes #8 🎉 Thanks @JoniVr! 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Apr 29, 2017)

    New Features:

    Custom Banner Style Colors

    You can now override the predefined colors that NotificationBanner uses for any style by conforming to the BannerColorsProtocol:

    public protocol BannerColorsProtocol {
        func color(for style: BannerStyle) -> UIColor
    }
    

    Its as easy as creating a custom banner colors class:

    class CustomBannerColors: BannerColorsProtocol {
    
        internal override func color(for style: BannerStyle) -> UIColor {
            switch style {
                case .danger:   // Your custom .danger color
                case .info:     // Your custom .info color
                case .none:     // Your custom .none color
                case .success:  // Your custom .success color
                case .warning:  // Your custom .warning color
            }
        }
           
    }
    

    And then passing in that class to any notification banner you create:

    let banner = NotificationBanner(title: title, style: .success, colors: CustomBannerColors())
    banner.show()
    

    Swipe Up Support

    Notification banners (by default) will now also be dismissed if the user swipes up on the banner. To detect when a user swipes up on a banner, simply:

    banner.onSwipeUp = {
    	// Do something regarding the banner
    }
    

    Better Documentation

    Added more documentation for most functions in most of the classes

    Source code(tar.gz)
    Source code(zip)
Owner
Dalton Hinterscher
Blessed husband and father who loves everything about iOS.
Dalton Hinterscher
In-app notification in Swift, with customizable buttons and input text field.

Notie Undistracted in-app notification in Swift, with added buttons and input box. Installation CocoaPods To integrate Notie into your Xcode project u

Thi Doãn 85 Aug 8, 2020
OEANotification is a customizable notification view framework

OEANotification OEANotification is an iOS library which provides to create notifications and customize them easily. You can create notifications with

Ömer Aslan 19 Jan 30, 2021
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.

StatusAlert is being sponsored by the following tool; please help to support us by takin a look and signing up to a free trial. Dependency managers Fe

Yehor Miroshnychenko 841 Dec 6, 2022
Swift library to manage in app notification in swift language, like WhatsApp, Telegram, Frind, ecc.

InAppNotify - Manage in App notifications During develop of my app Frind, I needed to manage in app notifications like whatsapp or telegram, but i did

Luca Becchetti 438 Nov 20, 2022
A crisp in-app notification/message banner built in Swift.

RMessage Screenshots Intro Welcome to RMessage! RMessage is a simple notification library written in Swift to help you display notification on the scr

Adonis Peralta 407 Nov 29, 2022
A modern iOS toast view that can fit your notification needs

CRToast CRToast is a library that allows you to easily create notifications that appear on top of or by pushing out the status bar or navigation bar.

Collin Ruffenach 4.2k Dec 30, 2022
A lightweight dropdown notification for iOS 7+, in Swift.

BRYXBanner A lightweight dropdown banner for iOS 7+. Usage Import BRYXBanner import BRYXBanner Create a banner using the designated initializer. let b

Bryx, Inc 1k Nov 20, 2022
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
Highly configurable iOS Alert Views with custom content views

NYAlertViewController NYAlertViewController is a replacement for UIAlertController/UIAlertView with support for content views and UI customization. Fe

Nealon Young 609 Nov 20, 2022
Emulates the native Remote Notification View.

Introduction HDNotificationView appears notification view like system. Requirement iOS 9.0+ Installation Carthage github "nhdang103/HDNotificationView

Nguyen Hai Dang 357 Nov 20, 2022
A simple and attractive AlertView to ask permission to your users for Push Notification.

A simple and attractive AlertView **to ask permission to your users for Push Notification.** PRESENTATION Ask permission to user for push notification

Boisney Philippe 37 Mar 23, 2022
Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside

Description ?? Break the silence of your UI, whispering, shouting or whistling at it. Whisper is a component that will make the task of displaying mes

HyperRedink 3.7k Dec 25, 2022
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit ?? Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Daniel Huri 6.1k Jan 4, 2023
iOS tweak to display toasts for Low Power alerts and charging

Electrode iOS tweak to display toasts for Low Power alerts and charging. Localization Want to help translate Electrode to your language? Sumbit a pull

null 8 Sep 7, 2022
DropView - A SwiftUI library to display Apple Pencil and Pasteboard-like alerts on iOS.

DropView is a SwiftUI-based library to display alerts inspired by the Apple Pencil and pasteboard stock ones.

Stefano Bertagno 46 Dec 4, 2022
Zingle – An alert will display underneath your UINavigationBar 🎅

Zingle Zingle – An alert will display underneath your UINavigationBar ?? ?? Note: Zingle has a dependency to have a UINavigationController in your app

Hemang 109 Jun 24, 2022
🚨Use the iPhone X Notch to display alerts. 🚨

NotchyAlert Prerequisites Xcode 9.x Swift 4.x iPhone X Simulator/Device Demo Installation Cocoapods To install NotchyAlert using Cocoapods, add the fo

Sofiane Beors 70 Nov 20, 2022
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Introduction Popup Dialog is a simple, customizable popup dialog written in Swift. Features Easy to use API with hardly any boilerplate code Convenien

Orderella Ltd. 3.8k Dec 20, 2022
A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

Ali Samaiee 11 Jun 6, 2022