- iOS 11.0+
- Xcode 9.0
Message Banner | StatusBar Banner |
---|---|
Progress Bar Banner | Custom Banner |
---|---|
Just add the RONotificationView folder to your project.
or use CocoaPods with Podfile:
pod 'RONotificationView'
- To use RONotificationView, you would be needing to create RONotificationConfiguration object. This configuration object is used to customize you banner.
-
-
For StatusBar Banner
isToAnimateView (Bool)
-- For enable/disable hide, show animations
duration (TimeInterval)
-- If need to hide view after some time. [Set 0 if want to hide manually]
messageTextColor (UIColor)
-- To set message text color
backgroundColor (UIColor)
-- To set banner background color
message (String)
-- To set message
messageFont (UIFont)
-- To set message Font -
For Message Banner
isToAnimateView (Bool)
-- For enable/disable hide, show animations
messageFont (UIFont)
-- To set message Font
titleFont (UIFont)
-- To set title Font
duration (TimeInterval)
-- If need to hide view after some time. [Set 0 if want to hide manually]
titleTextColor (UIColor)
-- To set title text color
messageTextColor (UIColor)
-- To set message text color
backgroundColor (UIColor)
-- To set banner background color
image (UIImage)
-- To show image on left side of banner
title (String)
-- To set title
message (String)
-- To set message
isToShowLoader (Bool)
-- To show loader on right side of banner -
For ProgressBar Banner
isToAnimateView (Bool)
-- For enable/disable hide, show animations
backgroundColor (UIColor)
-- To set banner background color
isToShowProgressCount (Bool)
-- To show ProgressCount in centre of progressBar
progressBarColor (UIColor)
-- To set progressbar color
progressCountFont (UIFont)
-- To set count font
progressCountColor (UIColor)
-- To set count text color
progressBarStartPosition (Float)
-- To set start value for progressBar (default = 0)
progressBarCurrentPosition (Float)
-- To set current value for progressBar (incase to start from different value other than start position)
progressBarEndPosition (Float)
-- To set end value for progressBar
isToAnimateProgressBarGradient (Bool)
-- Used to animate progressbar -
For Custom Banner
isToAnimateView (Bool)
-- For enable/disable hide, show animations
duration (TimeInterval)
-- If need to hide view after some time. [Set 0 if want to hide manually]
-
-
- For StatusBar Banner
let configuration = RONotificationStatusBarBannerConfiguration(message: MESSAGE, isToAnimateView: True)
- For Message Banner
let configuration = RONotificationMessageConfiguration(title: TITLE, message: MESSAGE, isToAnimateView: true)
- For ProgressBar Banner
let configuration = RONotificationProgressBarBannerConfiguration(progressBarColor: BAR_COLOR, progressBarStartPosition: 0, progressBarEndPosition: 100, isToAnimateView: true)
- For Custom Banner
let configuration = RONotificationCustomViewConfiguration(duration: DURATION, isToAnimateView: true)
- For StatusBar Banner
-
configuration.isToAnimateView = True ...
- After creating configuration for StatusBar Banner, You need to create StatusBar Banner Object.
-
- For StatusBar Banner
banner = RONotificationStatusBarBanner(presentOn: configurationView, config: configuration)
- For Message Banner
banner = RONotificationMessageBanner(presentOn: configurationView, config: configuration)
- For ProgressBar Banner
banner = RONotificationProgressBarBanner(presentOn: configurationView, config: configuration)
- For Custom Banner
banner = RONotificationCustomBanner(presentOn: configurationView, config: configuration, customView:customView)
- For Banner on Window
banner = Notification_View_Type(config: configuration)
- For StatusBar Banner
-
Want to change configuration for same banner ? 🤔
banner.updateConfiguration(config: configuration)
- Show your banner
-
Closure are optional.
banner.showBanner(onDismiss: Closure_For_On_Dismiss, onTap: Closure_For_On_Tap, onProgressCompleted: Closure_For_On_Progress_Completed)
- Hide your banner.
-
banner.hideBanner()
- For Auto-Hide Banner
OnDismiss closure will be called.
banner.showBanner(onDismiss: nil, onTap: nil)
- For Auto-Hide Banner
RONotificationView is released under the MIT license. See LICENSE for details.