A lightweight dropdown notification for iOS 7+, in Swift.

Last update: May 16, 2022

BRYXBanner

Version Carthage compatible License Platform

A lightweight dropdown banner for iOS 7+.

Example

Usage

Import BRYXBanner

import BRYXBanner

Create a banner using the designated initializer.

let banner = Banner(title: "Image Notification", subtitle: "Here's a great image notification.", image: UIImage(named: "Icon"), backgroundColor: UIColor(red:48.00/255.0, green:174.0/255.0, blue:51.5/255.0, alpha:1.000))
banner.dismissesOnTap = true
banner.show(duration: 3.0)

If you want the banner to persist until you call .dismiss(), leave the argument out of the call to .show()

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Demo project requires iOS 8, though BRYXBanner works on iOS 7+.

Installation

BRYXBanner is available through CocoaPods and Carthage.

Using CocoaPods

To install it, simply add the following line to your Podfile:

pod 'BRYXBanner'

If you need to support iOS 7, just copy Banner.swift into your Xcode project.

Using Carthage

Create a Cartfile in your project directory and add the following line.

github "bryx-inc/BRYXBanner"

Run carthage update from the command line. This will build the framework. The framework will be within Carthage/build/BRYXBanner.framework.

Add the framework to your project by going to your app's targets and selecting the General tab. Drag the built framework onto Linked Frameworks and Libraries

Go to the Build Phases tab, click the + sign and add a new run script phase. Then add the following:

/usr/local/bin/carthage copy-frameworks

to the box under Shell. Finally click + to add a new input file. Replace the default with:

$(SRCROOT)/Carthage/Build/iOS/BRYXBanner.framework

Now build and run. You're all set! More information on Carthage is available here.

Documentation

Docs are automatically generated and available right here.

Authors

Harlan Haskins (@harlanhaskins) Adam Binsz (@adambinsz)

License

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

GitHub

https://github.com/bryx-inc/BRYXBanner
Comments
  • 1. Carthage install, received warning

    After doing a Carthage install, I received this warning: warning: use of string literal for Objective-C selectors is deprecated; use '#selector' instead

    Would you be able to update for this?

    Reviewed by daver234 at 2016-08-28 05:34
  • 2. Using the same banner will cause an incorrect width

    When using the same banner more than once, the width of the banner will shrink to the hug the text content. This is likely an issue of not resting the layout of the view. An example is below. bug png

    Reviewed by mosabelagha at 2015-10-25 06:26
  • 3. Carthage Framework not Built

    Hi,

    When I add BRYXBAnner to my cart file github "bryx-inc/BRYXBanner"it gets checked out but a framework isn't built, my guess is that the Scheme for the Framework isn't shared as I can't see it in the version that is checked out by Carthage?

    Reviewed by ObjColumnist at 2015-08-14 10:08
  • 4. Fixed Height Calculations

    Fixed layout issues where height was not being calculated properly wh…en showing banner based on if it was being show in a view or the window and the appearance of the status bar.

    • When shown in a view other than the topWindow, the banner's minimum height is 0, so that the banner sizes to it's content.
    • When show in a view other than the topWindow, the height offset for the status bar no longer applies.
    • When shown in the topWindow while the status bar is not shown (such as when in landscape orientation), the height offset for the status bar no longer applies.
    • When shown in the topWindow while the status bar is not shown (such as when in landscape orientation), the minimum height for the status bar is set to a more appropriate height of 40.
    • All of the above changes update automatically upon orientation change.
    Reviewed by AnthonyMDev at 2015-11-03 01:01
  • 5. Wrong width

    Hi guys, when I show the banner on a tableView it appears smaller than the tableView. In the image the tableView is the yellow one and the banner obviously is the red one. simulator screen shot 26 set 2015 16 29 12

    Reviewed by MaxFrax at 2015-09-26 14:30
  • 6. MinimumHeight not work on with Bottom appear

    Hi,

    I have a issue with minimumHeight property. If you show banner from bottom, this property not work (with Xcode inspector I see auto layout issue)

    If shown from top, minimumHeight works ONLY IF show is used without view (passing nil)

    Thank you

    Reviewed by m3rLin0WoRK at 2017-11-28 15:25
  • 7. Updated Swift Syntax to Xcode Beta 6 and Fixed Banner Animations on iOS 10

    Hi guys, the title says it all.

    I've described the animation problem in https://github.com/bryx-inc/BRYXBanner/issues/51 , today I've found a bit of time and fixed it.

    The problem originates from a -layoutIfNeeded incorrect behaviour on iOS 9.

    I've found out about this by reading the Release Notes of iOS 10 Beta 6.

    For your convenience, here's the interesting part (Under UIKit Notes and Known Issues):


    Sending -layoutIfNeeded to a view is not expected to move the view, but in earlier releases, if the view had translatesAutoresizingMaskIntoConstraints == false, and if it was being positioned by constraints, -layoutIfNeeded would move the view to match the layout engine before sending layout to the subtree.

    These changes correct this behavior, and the receiver’s position and usually its size won’t be affected by -layoutIfNeeded.

    Some existing code may be relying on this incorrect behavior that is now corrected. There is no behavior change for binaries linked before iOS 10, but when building on iOS 10 you may need to correct some situations by sending -layoutIfNeeded to a superview of the translatesAutoresizingMaskIntoConstraints == false view that was the previous receiver, or else positioning and sizing it before (or after, depending on your desired behavior) -layoutIfNeeded.


    Cheers!

    Reviewed by zntfdr at 2016-08-19 15:25
  • 8. Swift 2.3 release

    I see there's no working Swift 2.3 release as the iOS 10 animation fixes were bundled with the Swift 3 syntax changes. Is there any chance of doing a release for those of us who are sticking to Swift 2.3 for the time being?

    Reviewed by jannemecek at 2016-09-18 07:55
  • 9. Feature Proposal - Banner Templates

    It would be nice to have some pre-made template banners that have a preset color and image for some common uses.

    For example:

    • Error - red with an error icon
    • Warning - yellow with an error icon
    • Success - green with a checkmark icon

    I'd like to create a BannerTemplateType protocol and add a convenience initializer that takes a BannerTemplateType as a parameter.

    Then, I would create a few structs that conform to BannerTemplateType for the pre-made templates. This allows users to easily create their own banner templates, or even make their custom error types conform to BannerTemplateType to be easily displayed.

    @harlanhaskins I'd be willing to make a PR for this if you are interested. I wanted to get your thoughts on this before I started implementation.

    Reviewed by AnthonyMDev at 2015-12-30 19:35
  • 10. Allow customization of position (top or bottom)

    Allow the option of positioning the banner to the top or bottom of the view. I've done this myself in a hacky way, but can make an actual solution whenever I have time

    Reviewed by mosabelagha at 2015-12-11 19:06
  • 11. cannot pod install

    Resolving dependencies of Podfile [!] Unable to satisfy the following requirements:

    • BRYXBanner required by Podfile

    /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:388:in handle_resolver_error' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:69:inrescue in resolve' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:56:in resolve' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:535:inblock in resolve_dependencies' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:59:in section' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:533:inresolve_dependencies' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:70:in analyze' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:210:inanalyze'

    Reviewed by longxianlin at 2015-09-24 07:18
  • 12. BRYXBanner/BRYXBanner-Swift.h file not found

    I am using react-native-notification-banner, when I ran the pod install it install it installs RNNotificationBanner BRYXBanner but when i am running the project it fails with an error

    'BRYXBanner/BRYXBanner-Swift.h' file not found

    What I have to do for resolving this ??

    Reviewed by diivyu at 2020-09-26 12:54
  • 13. Is there any user data that is either being collected or Tracked by the BRYXBanner

    As part of the iOS 14 /AppTracking Transparency framework, would like to know if any kind of the user data is collected or Tracked by the BRYXBanner.

    As mentioned in the Apple (Ref: https://developer.apple.com/support/app-privacy-on-the-app-store/), below were some of the examples for Tracking:

    • Sharing device location data or email lists with a data broker.
    • Placing a third-party SDK in our app that combines user data from the app with user data from other developers’ apps to target advertising or measure advertising efficiency, even if we don’t use the SDK for these purposes. For example, using a login SDK that repurposes the data it collects from the app to enable targeted advertising in other developers’ apps.

    The following situations are not considered tracking:

    • When the data is linked solely on the end-user’s device and is not sent off the device in a way that can identify the end-user or device.
    • When the data broker uses the data shared with them solely for fraud detection or prevention or security purposes, and solely on our behalf.
    Reviewed by ghost at 2020-09-22 19:08
  • 14. Deployment Target is set to 8.0

    Trying to update and recompile this. I get the following error.

    Build Failed Task failed with exit code 1: The log file shows the following warning in it.

    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'BRYXBanner' from project 'Pods')

    Let me know if need any additional details.

    Reviewed by rudenik at 2020-09-21 16:41
Simple DropDown Alert View For Any iOS Projects.
Simple DropDown Alert View For Any iOS Projects.

⚠️ DEPRECATED, NO LONGER MAINTAINED JDropDownAlert JDropDownALert Simple DropDown Alert View For Any iOS Projects. Usage Top let alert = JDropDown

Oct 8, 2021
Swift library to manage in app notification in swift language, like WhatsApp, Telegram, Frind, ecc.
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

May 9, 2022
The easiest way to display highly customizable in app notification banners in iOS
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

May 17, 2022
A modern iOS toast view that can fit your notification needs
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.

May 11, 2022
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

May 16, 2022
A crisp in-app notification/message banner built in Swift.
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

May 3, 2022
In-app notification in Swift, with customizable buttons and input text field.
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

Aug 8, 2020
Emulates the native Remote Notification View.
Emulates the native Remote Notification View.

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

Apr 19, 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.

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

Mar 23, 2022
OEANotification is a customizable notification view framework
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

Jan 30, 2021
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.

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

Jan 1, 2022
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
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

May 18, 2022
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Apr 23, 2022
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
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

May 16, 2022
Live animated Alert View for iOS written in Swift
Live animated Alert View for iOS written in Swift

Sweet Alert iOS Beautiful Animated custom Alert View inspired from javascript library SweetAlert. Written in Swift this SweetAlertView can be used in

May 11, 2022
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞

Toast-Swift A Swift Toast view - iOS 14 style - built with UIKit. ?? Installation Swift Package Manager You can use The Swift Package Manager to insta

May 12, 2022
A Swift package for iOS/tvOS for easy alert presentation

AlertPresenter Listed on the Swift Package Index and originally posted on my blog. It can be fiddly to handle the presentation of alerts on a specific

May 8, 2022
Awesome iOS 11 appstore cards in swift 5.
Awesome iOS 11 appstore cards in swift 5.

Cards brings to Xcode the card views seen in the new iOS XI Appstore. Getting Started Storyboard Go to main.storyboard and add a blank UIView Open the

May 23, 2022
A message bar for iOS written in Swift.
A message bar for iOS written in Swift.

Dodo, a message bar for iOS / Swift This is a UI widget for showing text messages in iOS apps. It is useful for showing short messages to the user, so

Feb 14, 2022