TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by joehour.
A foreground notification banner library, easy to use and customizable.
Copy the NotificationBanner Directory to your project. Go ahead and import NotificationBanner to your file.
import NotificationBanner
class ViewController: UIViewController, NotificationBannerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
//Show NotificationBanner
showNotificationBanner(bannerStyle: .successMessage, bannerLocation: .Top,
messageTitle: "Success", messageContent: "This is a Success notification")
}
//NotificationBanner click event(required)
func notificationBannerClick(_ view: NotificationBannerView) {
//Dissmiss NotificationBanner
dissmissBanner(completion: { Sucess in _ = Bool()
if(Sucess){
}
}
)
}
}
You can configure NotificationBanner properties.
bannerStyle: .successMessage //Success style
bannerStyle: .infoMessage //Info style
bannerStyle: .warningMessage //Warning style
bannerStyle: .errorMessage //Error style
bannerStyle: .customView //Custom style
bannerLocation: .Top //Top
bannerLocation: .Bottom //Bottom
messageTitle: String //title message
messageContent: String //content message
messageTitleFont: CGFloat //title string font, default is 25
messageContentFont: CGFloat //content string font, default is 15
bannerHeight: Int //banner height, default is 80
bannerHoldTime: Int //banner hold time, default is 5 sec
bannerBackgroundColor: UIColor //banner background color
bannerImage: UIImage //banner icon image
NotificationBanner is available under the MIT License.
Copyright © 2016 Joe.