GithubHelp home page GithubHelp logo

daltron / notificationbanner Goto Github PK

View Code? Open in Web Editor NEW
4.7K 49.0 653.0 24.99 MB

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

License: MIT License

Swift 98.61% Ruby 0.91% Objective-C 0.48%
swift swift3 ios ios-animation ios-swift

notificationbanner's Introduction

Notification Banner

GitHub contributors License PayPal

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 ✅
  • Dynamic Island Support ✅

Requirements

  • iOS 12.0+
  • Xcode 10.0+

Installation

Swift Package Manager

This is the preferred way. All other installation methods are officially deprecated and will no longer be supported in future versions.

  1. Go to File > Add Packages
  2. The Add Package dialog appears, by default with Apple packages.
  3. In the upper right hand corner, paste https://github.com/Daltron/NotificationBanner into the search bar
  4. Hit Return to kick off the search
  5. Click Add Package.

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.

notificationbanner's People

Contributors

arfrakk avatar ben9923 avatar cbpowell avatar chickdan avatar daltron avatar ecastillo avatar jeehut avatar joseantoniogarciay avatar limorcohen avatar martinmaly21 avatar misteu avatar morgan-legal avatar mrsnow-git avatar mrweatherman208 avatar niltsh avatar oscarsilver avatar pawin avatar petrpavlik avatar pikachu987 avatar rolandkakonyi avatar ronaldoh1 avatar roostr avatar shanev avatar shayanaghajan avatar sieren avatar styrken avatar truongtho1603 avatar weitieda avatar xbauquet avatar yauheniyarotski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notificationbanner's Issues

Wrong version of Snapkit

Installed the pod to my project (written in Swift 4) and it won't work because 'NotificationBanner' uses Snapkit 3.2. Snapkit 4.0 is required for Swift 4 (see https://github.com/SnapKit/SnapKit).

Please fix asap and thanks for an amazing pod otherwise, super excited to use it.

using from Objective-c

I'm attempting to use this from Objective-c. Running into problems though with BannerStyle enum and trying to instantiate a StatusBarNotificationBanner.

Any pointers would be appreciated.

UIFont has no member Weight

UIFont.Weight.Bold doesn't compile and needs to be UIFontWeightBold

StatusBarNotification.swift
titleLabel!.font = UIFont.systemFont(ofSize: 12.5, weight: UIFontWeightBold)

NotificationBanner.swift
titleLabel!.font = UIFont.systemFont(ofSize: 17.5, weight: UIFontWeightBold)

UITableViewController issue

Hi there, great lib 👍

I'm having an issue using it with a UITableViewController, if I scroll the table the banner does not show at the bottom of the navBar, seems the banner scrolls with the tableView all the way to the top.

Any ideas?

Issue cocoapods

Hello, it seems there's an issue with cocoapods installation. Unable to find a specification for NotificationBannerSwift. Maybe there is a issue with the name....

captura de pantalla 2017-06-07 a las 12 24 19

Title label gets truncated instead of scrolling with custom duration

The titlelabel of a NotificationBanner does not scroll if a custom duration is set for the banner, instead it gets truncated at the end.
I didn't check for the subtitle or status banner.

 func successNotificationBanner(_ text: String, subtitle: String){
    showBanner(NotificationBanner(title: text, subtitle: subtitle, style: .success))
}

private func showBanner(_ banner: BaseNotificationBanner){
    //banner.duration = 2.5 <- Won't scroll with this set
    banner.show()
}

Called as

successNotificationBanner( * Really long text here * , subtitle: *Subtitle here*)

Also won't scroll doing it the standard way

let banner = NotificationBanner(title: *etc..*, subtitle: *sub*, style: .success)
banner.duration = 2.5
banner.show()

Adjust subtitle font to fit

I have a relatively big subtitle but trying to resize the 'MarqueeLabel' wont work:

self.adjustsFontSizeToFitWidth = true
self.minimumScaleFactor = withScale
self.numberOfLines = numberOfLines

Can I change the font of the label so it can fit my text in one or two lines ? Thanks

Banners from the bottom?

Looks like a great library here. I'm considering a strange use case - may not fit with your intent, but figure I'll ask here. Feel free to close this feature request if it's too odd.

I'd like to have a custom view animatable from the bottom upwards. This alone would be good, but the ultimate trick-shot would be to tie it to a scroll view such that it only animates in when the scroll view is not scrolling.

Let me know if either might fit with your thinking - if so, I might help implement it too.

Thanks!
./scc

Show banners infinitely

Currently, banners can be shown infinitely by passing in a large value to the duration property. It would be better if each banner had a boolean value to indicate wether or not it should be shown infinitely.

Static multiline subtitles

Hi @Daltron,

Very cool library! While implementing it we found that currently it's not possible to have multi-line subtitles instead of scrolling ones. Would it be possible to add a functionality for a static multi-line subtitles?

Thanks,
Mazvydas

SnapKit dependencies causing errors within code whilst using NotificationBannerSwift

I believe that NotificationBannerSwift dependencies require the use of SnapKit (> 3.2.0) but that version is only for Swift 3, SnapKit latest Swift 4 version SnapKit (> 4.0.0) must be used.
The problem is I received is when trying to use NotificationBannerSwift in Swift 4/ Xcode 9 it uses this old version of SnapKit.
I have tried to install SnapKit separately but the version conflict awn trying to install notificationBanner

Multiline subtitle

Would it be possible to have a multiline subtitle, instead of a horizontal scrolling?
The height of the banner should auto size then..

Multiline subtitles

I've read PR #14, but I think there's an alternate solution by offering a property or something like useMarquee and using a standard UILabel. Unfortunately at the moment I'm going to have to use a different library because I need multiline.

Custom Font and Font Size

Please make the font and font sizes of the banner public so an app can integrate the banner to fit their app.

toolBar view hides when banner appears

Hello, awesome library!
I have a problem: when keyboard with toolbar is active and banner appears, toolbar disappears until banner dismissed. Sometimes when i type something and banner appears again toolbar does not disappears. I do simple banner.show() so banner displays on main app window. If i show banner on my tabbarcontroller everything is fine except one thing - banner shows under status bar.
img_0640
img_0642

NotificationBanner not showing in new SpriteKit app

I'm trying to show a welcome message when my SpriteKit game opens. I tried to use the example NotificationBanner in the override func viewDidLoad() of the GameViewController, but nothing shows up. I discovered that if I have 2 banners show, then the 2nd one will show up after a delay (~5sec). Im assuming that this delay is due to the 1st one being shown. How should I deal with this? Call it from a different place within my initial view controller?

let banner = NotificationBanner(title: "Welcome back!", subtitle: "We are watching...", style: .success)
        banner.show()
        
let banner2 = NotificationBanner(title: "Welcome back again!", subtitle: "We are watching you too...", style: .success)
        banner2.show()

Dependency "NotificationBanner" has no shared framework schemes

$ carthage update
*** Fetching NotificationBanner
*** Checking out NotificationBanner at "1.2.0"
*** xcodebuild output can be found in /var/folders/3d/0_7l4jkd7pz0xpzzv56rddnh0000gn/T/carthage-xcodebuild.gg0Xl3.log
*** Skipped building NotificationBanner due to the error:
Dependency "NotificationBanner" has no shared framework schemes

If you believe this to be an error, please file an issue with the maintainers at https://github.com/Daltron/NotificationBanner/issues/new

Carthage Compatiblity

Currently one can only install NotificationBanner via CocoaPods which is a pity since Carthage is the much cleaner solution to dependency management (it's much less intrusive than CocoaPods). Support for Carthage would enable the many Carthage users to use this otherwise great library, too.

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

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)

NotificationBannerUtilities is not connected to the project, v1.4.5

Carthage during buld gives: Carthage/Checkouts/NotificationBanner/NotificationBanner/Classes/BaseNotificationBanner.swift:418:16: error: use of unresolved identifier 'NotificationBannerUtilities'
return NotificationBannerUtilities.isiPhoneX()
If to open the project, you will see that file NotificationBannerUtilities.swift exists, but not connected.

Remove banners added to the Queue

There should be a way we should be able to remove the banners lined up in the BannerQueue. This is in consideration that, I added some items to the queue and I have another notification coming up, which will take highest priority and displaying the banners in the queue is of no use. I've created a patch file as well with the necessary methods.

You can access the new methods in two ways.

  1. If there is a new banner with highest priority to be displayed, create the banner using the following way. And using the same banner instance, call the clearBannerQueue() method.

let banner = StatusBarNotificationBanner(title: "Highest priority message")
banner.clearBannerQueue()
banner.show(on: self)

  1. If you just wanted to clear the bannerQueue, you can use the NotificationBannerQueue instance and clear them

NotificationBannerQueue.default.clearBannerQueue()

Please find the attached patch file. This patch file was created on top of the Commit numbered 2c41cf4
patch.diff.zip

Some features..

Hi,
I'm not really sure how I can add a "feature request" label to an issue, but anyways.
First of all, I really like this, it's really easy to use and very clean UI wise, great work!!

Had a couple of things in mind that would be nice additions:

  • the option to disable new banners when a banner is currently active.
  • the option to easily set how long a banner is shown, and to be able to check programmatically if a banner is currently being displayed.

I would help out, but I'm currently way too busy with various projects and lots of schoolwork so I don't really have the time for it atm..

Anyways, just some things that came to my mind for possible features, thanks again! 😁

SnapKit v4 for Swift 4

Hello,
Please update SnapKit dependency to v4.0 to be Swift 4.x and iOS 11 compatible.
Right now I cannot build the app.
Thanks

Request priority system

Hi ! Nice lib !
I'm thinking about extending your queue system with an arbitrary priority system (a bit like NSConstraint). You add the notification with a priority value and then the queue decide the display order instead of when it's added. We could set default like high number for error, small for info.

I don't know if I'm clear but this system would reduce dev think about should my banner go on top or on the bottom of the queue :)

'NotificationBanner' has no member 'haptic'

I am working with Xcode 9 Beta 1 (maybe this is just a problem with code 9) and I cannot add the line banner.haptic = .heavy without getting the error "Value of type 'NotificationBanner' has no member 'haptic.'"

iOS 8 Support

Will this project have iOS 8 support in the future?

iPhoneX safe area not respected.

Hi Daltron!

You are probably already aware of this issue, but I thought it wouldn't hurt to just post it here.
So I tested this library for my project on the iPhone X, and the notifications don't seem to respect the safe area, causing it to be hidden behind the notch.

I'd fix it myself but I'm not that good with SnapKit and code constraints in general.

Thanks for your great work!

Best regards,
Joni

Presentation from beneath navigation bar?

Not sure if this would be handy for other folks too but for my purposes I need to sho the notification for a longer than usual time ~20 seconds, but I'd rather cover the nav bar buttons / interactions.

iOS Minimum Version 9.0 + Tag

Hi Dalton,

First of all, kudos on the lib, easy to use and does everything that I need!

I'm creating an issue for the minimum iOS version of the project which is actually 9.3 instead of 9.0 (as documented in the readme). I've forked and tested it and it won't create any issue.

If you do change the minimum iOS version, is it possible to create a new tag (1.4.1). I'm using Carthage and I'm not a huge fan on pointing directly to the master branch as mentioned it in the readme.

Thank again for everything!
Morgan

Right to left error

Hello, is it available to view right to left text and make all view from right to left?

Carthage Fails to Build

I have decided to try and use Carthage for our new framework, but when I use github "Daltron/NotificationBanner" ~> 1.4.0 I get several build errors. I was able to get everything working with github "Daltron/NotificationBanner" == 1.3.3. Is this something I'm messing up or is there a problem with the latest?

iOS 9?

If I used on iOS 8 now, ok?Whether to support iOS 8?

Allow offset?

I have a second use case where I need the notification to appear below a view (which has a search bar). I've tried using a container view (essentially a dummy view) to then pass the on viewController: optional UIViewController parameter - it has a rather funny effect of animating from where I want, but goes up instead of down and disappears before it finishes its animation.

I'm using a custom view for that case, if that matters.

So - either I need the bannerPositionFrame: BannerPositionFrame! variable to be exposed, or some way to set an offset (from the top, but you could imagine it just based on whatever is passed for the bannerPosition: BannerPosition! variable.

Lastly - not that it matters here, but just wondering if the bannerPosition and bannerPositionFrame variables should be explicitly unwrapped optionals? They do start out as nil (indeed you check for that in the start of BaseNotificationBanner.show(). Of course, they're private at the moment so the class is free to tell me off; they're it's business not mine.

Thanks again - great library!

delegates?

Would be nice to know when the alert has been dismiss or is about to show.

Haptic Feedback Crash

I have a NotificationBanner appear on startup if the user is not connected to the internet. If the code is not called on the main thread, the app crashes with *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ERROR: -[_UIFeedbackHapticOnlyEngine _deactivate] called more times than the feedback engine was activated'. I fixed it by putting all of the NotificationBanner code in DispatchQueue.main.async { }

A link to a StackOverflow post

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.