BEEPopupKit
示例
要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install
。
要求
安装
BEEPopupKit 可以通过 CocoaPods 获得。要安装它,只需将以下行添加到 Podfile 中
pod 'BEEPopupKit'
使用方法
快速使用
// Customized view
let customView = SomeCustomView()
/*
Do some customization on customView
*/
// Attributes struct that describes the display, style, user interaction and animations of customView.
var attributes = BEEAttributes()
/*
Adjust preferable attributes
*/
然后,只需调用
BEEPopupKit.display(entry: customView, using: attributes)
警告
let alert = BEEAlertView(title: "我是主标题", message: "我是副标题", imageName: "info")
let action1 = BEEAlertAction(title: "确定", style: .default) { (action) in
print("点击了确定")
}
let action2 = BEEAlertAction(title: "取消", style: .destructive) { (action) in
print("点击了取消")
}
action2.titleColor = BEEColor(.red)
alert.addAction(action1)
alert.addAction(action2)
alert.show()
操作表
let actionSheet = BEEActionSheetView(title: "我是主标题", message: "我是副标题", imageName: "zhiwen")
let action1 = BEEAlertAction(title: "Default", style: .default) { (action) in
print("点击了Default")
}
let action2 = BEEAlertAction(title: "Destructive", style: .destructive) { (action) in
print("点击了Default")
}
let action3 = BEEAlertAction(title: "Cancel", style: .cancel) { (action) in
print("点击了Default")
}
actionSheet.addAction(action1)
actionSheet.addAction(action3) // 取消按钮一定排在最底部
actionSheet.addAction(action2)
actionSheet.show()
作者
liuxc123, [email protected]
许可证
BEEPopupKit 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。