Under Developement ......
NotificationAlertBanner
NotificationAlertBanner
样式
类型 | 类型 | 类型 |
---|---|---|
1. 二维 | 2. r2L | 3. l2R |
4. 二维详细信息 | 5. r2L详细信息 | 6. l2R详细信息 |
7. 二维图片详细信息 | 8. r2L图片详细信息 | 9. l2R图片详细信息 |
使用
首先,导入 NotificationAlertBanner。
import NotificationAlertBanner
初始化
NotificationAlertBanner.add(style: .t2D, title: "title", details: "details", logoImage: UIImage(named: "logo_image"), informationImage: UIImage(named: "information_image"))
import UIKit
import NotificationAlertBanner
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: 50))
button.setTitle("Click", for: .normal)
button.setTitleColor(.red, for: .normal)
button.addTarget(self, action: #selector(btnClick), for: .touchUpInside)
button.center = view.center
view.addSubview(button)
}
@objc func btnClick(sender:UIButton) {
NotificationAlertBanner.add(style: .t2D, title: "title", details: "details", logoImage: UIImage(named: "logo_image"), informationImage: UIImage(named: "information_image"))
}
}
修改
NotificationAlertBanner.bannerBackGroundColor = UIColor.white
NotificationAlertBanner.bannerTitleFontColor = UIColor.black
NotificationAlertBanner.bannerDetailsFontColor = UIColor.red
NotificationAlertBanner.bannerBackGroundImage = UIImage(named: "background_image")
NotificationAlertBanner.bannerBorderColor = .black
NotificationAlertBanner.bannerBorderWidth = 2
NotificationAlertBanner.bannerTitleFontName = "MarkerFelt-Thin"
NotificationAlertBanner.bannerDetailsFontName = "MarkerFelt-Thin"
CocoaPods 安装
pod 'NotificationAlertBanner', '0.0.9'