测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年6月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Burak Üstün 维护。
要运行示例项目,首先克隆仓库,然后从 Example 目录中运行 pod install
设置 BUSimplePopupManager
import UIKit
import BUSimplePopup
class ViewController: UIViewController {
let PopupManager = BUSimplePopupManager()
override func viewDidLoad() {
super.viewDidLoad()
PopupManager.PopupsBackgroundColor = .white
PopupManager.PopupsTitleTextColor = .black
PopupManager.PopupsBodyTextColor = .darkGray
PopupManager.PopupBackgroundAlpha = 1.0
PopupManager.PopupsTitleFont = UIFont.init(name: "Futura", size: 20)!
}
创建弹出窗口并显示!
let popup:BUSimplePopup = BUSimplePopup.init(_title: "BUSimplePopup",
_body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
_image: UIImage.init(named: "logo"))
PopupManager.showPopup(Popup: popup)
您可以自定义以下所有内容
/**
* The active Popup, if there is one. nil if no Popup is currently active.
*/
public var activePopup: BUSimplePopupView?
/**
* Use to set the background color of Popups.
*/
public var PopupsBackgroundColor: UIColor = UIColor.white
/**
* Use to set the title text color of Popups
*/
public var PopupsTitleTextColor: UIColor = UIColor.black
/**
* Use to set the title text aligment of Popups
*/
public var PopupsTitleTextAligment: NSTextAlignment = .center
/**
* Use to set the body text aligment of Popups
*/
public var PopupBodyTextAlignment: NSTextAlignment = .center
/**
* Use to set the Popup image Width
*/
public var PopupImageWidth:CGFloat = 75.0
/**
* Use to set the Popup image Height
*/
public var PopupImageHeight:CGFloat = 75.0
/**
* Use to set the Popup background alpha
*/
public var PopupBackgroundAlpha:CGFloat = 1.0
/**
* Use to set the body text color of Popups.
*/
public var PopupsBodyTextColor: UIColor = UIColor.black
/**
* Use to set the title font of Popups.
*/
public var PopupsTitleFont: UIFont = UIFont.boldSystemFont(ofSize: 14.0)
/**
* Use to set the body font of Popups.
*/
public var PopupsBodyFont: UIFont = UIFont.systemFont(ofSize: 12.0)
BUSimplePopup 通过 CocoaPods 提供。要安装它,只需将以下行添加到你的 Podfile 中
pod "BUSimplePopup"
Burak Üstün
[email protected]
Twitter.com/burakustn
BUSimplePopup 以 MIT 许可证提供。有关更多信息,请参阅 LICENSE 文件。