NotificationBanner

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

MIT License

Stars
4.7K
Committers
76

Bot releases are hidden (Show)

NotificationBanner - NotificationBanner Release v1.3.3

Published by Daltron over 7 years ago

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! ๐Ÿ‘

NotificationBanner - NotificationBanner Release v1.3.2

Published by Daltron over 7 years ago

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 โœ…

NotificationBanner - NotificationBanner Release v1.3.0

Published by Daltron over 7 years ago

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! ๐Ÿ‘

NotificationBanner - NotificationBanner Release v1.2.0

Published by Daltron over 7 years ago

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! ๐Ÿ‘

NotificationBanner - NotificationBanner Release v1.1.0

Published by Daltron over 7 years ago

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

Package Rankings
Top 0.44% on Cocoapods.org
Top 5.47% on Carthage
Badges
Extracted from project README
GitHub contributors License PayPal Q - Talk About Music VH Dispatch Stikkr CardCast Happy Scale Wanderings Modern Magic 8 Ball Envision: Habits Tracker TSUM RIS LukaPizza
Related Projects