HBStatusBarNotification 1.1.1

HBStatusBarNotification 1.1.1

测试已测试
Lang语言 SwiftSwift
许可协议 MIT
发布最后发布2019年1月
SPM支持SPM

Haven Barnes维护。



  • havenbarnes

HBStatusBarNotification

CI Status Version License Platform

HBStatusBarNotification是一个极其轻量级的解决方案,只需一行代码即可在iOS应用中的任何位置快速发送状态栏覆盖通知。无需任何额外的设置或配置。

使用方法

使用HBStatusBarNotification非常简单

HBStatusBarNotification(message: "Internet Connection Lost", backgroundColor: UIColor.red).show()

可选地,您可以自定义其他外观/行为组合

let notification = HBStatusBarNotification(message: "Internet Connection Lost", 
                        backgroundColor: UIColor.black, 
                        textColor: UIColor.red, 
                        statusBarStyle: .lightContent, 
                        duration: 6.0, 
                        font: UIFont(name: ".SFUIDisplay-Heavy", size: 10)!, 
                        notificationHeight: 40)
notification.show()

通知将尝试减小较长的字符串大小,如果它们无法适应指定字体尺寸的屏幕宽度。

示例

要运行示例项目,请克隆仓库,然后首先从示例目录运行pod install

安装

HBStatusBarNotification 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod "HBStatusBarNotification"

作者

havenbarnes,[email protected]

许可

HBStatusBarNotification 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。