欢迎光临
我们一直在努力

StatusBarNotification

建站超值云服务器,限时71元/月

StatusBarNotification

项目介绍:

StatusBarNotification

DEMO 直接下载:




Installation
CocoaPods:
not support



Manually:

  • Drag the DBStatusBarNotification/DBStatusBarNotification folder into your project.
  • Add #include "StatusBarNotification.h", where you want to use it

Usage
StatusBarNotification is a singleton. You don’t need to initialize it anywhere.Just use the following class methods:



Showing a notification
[Objective-C] 查看源文件 复制代码

class func showWithStatus(status: String) -> UIView?
class func showWithStatus(status: String, timeInterval: NSTimeInterval) -> UIView?



The return value will be the notification view. You can just ignore it, but if you need further customization, this is where you can access the view.


Dismissing a notification
class func dismiss()
class func dismissAfter(delay: NSTimeInterval)

Showing progress

[Objective-C] 查看源文件 复制代码

class func showProgress(progress: CGFloat)  // Range: 0.0 - 1.0

Showing activity

[Objective-C] 查看源文件 复制代码

class func showActivityIndicator(show: Bool, style:UIActivityIndicatorViewStyle)


Showing a notification with alternative styles
Included styles:



Use them with the following methods:

[Objective-C] 查看源文件 复制代码

class func showWithStatus(status: String, styleName: String) -> UIView? class func showWithStatus(status: String, timeInterval: NSTimeInterval, styleName: String) -> UIView?

To present a notification using a custom style, use the identifier you specified in addStyleNamed:prepare:. See Customization below.


Customization
[Objective-C] 查看源文件 复制代码

class func setDefaultStyle(prepareBlock: PrepareStyleBlock?) 
class func addStyleNamed(identifier: String, prepareBlock:PrepareStyleBlock) -> String {

The prepareBlock gives you a copy of the default style, which can be modified as you like:
[Objective-C] 查看源文件 复制代码

StatusBarNotification.addStyleNamed(<#identifier#>) { (style) -> StatusBarStyle in

                                                     // main properties
                                                     style!.barColor  = <#color#>
                                                     style!.textColor = <#color#>
                                                     style!.font = <#font#>

                                                     // advanced properties
                                                     style.animationType = <#type#>;
                                                     style.textShadow = <#shadow#>;
                                                     style.textVerticalPositionAdjustment = <#adjustment#>;

                                                     // progress bar
                                                     style.progressBarColor = <#color#>;
                                                     style.progressBarHeight = <#height#>;
                                                     style.progressBarPosition = <#position#>;
                                                     return style!
                                                    }

Animation Types

  • None
  • Move
  • Bounce
  • Fade

Progress Bar Positions

  • Bottom
  • Center
  • Top
  • Below
  • NavBar
赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » StatusBarNotification
分享到: 更多 (0)