测试兼容性测试 | ✗ |
语言支持的编程语言 | SwiftSwift |
许可证 | MIT |
发布日期最新发布日期 | 2016年6月 |
SPM支持 Swift Package Manager (SPM) | ✗ |
由 nohirap 维护。
要运行示例项目,请克隆仓库,然后先从 Example 目录中运行 pod install
。
ANActionSheet 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行:
pod "ANActionSheet"
在导入 ANActionSheet 后,当您想要显示视图时,请使用以下代码:
let actionSheet = ANActionSheet(title: "Title", message: "Message!!!")
actionSheet.headerBackgroundColor = UIColor.blackColor()
actionSheet.titleColor = UIColor.redColor()
actionSheet.messageColor = UIColor.greenColor()
actionSheet.buttonsBorderColor = UIColor.blackColor()
let action1 = ANAction(title: "First Button", style: .Default) {
NSLog("Tap First Button!!!")
}
action1.buttonColor = UIColor.redColor()
action1.labelNumberOfLines = 3
actionSheet.addAction(action1)
let action2 = ANAction(title: "Second Button", style: .Default) {
NSLog("Tap Second Button!!!")
}
action2.buttonColor = UIColor.blueColor()
action2.labelColor = UIColor.greenColor()
actionSheet.addAction(action2)
let action3 = ANAction(title: "Third Button\nThird Button\nThird Button\nThird Button\nThird Button\nThird Button", style: .Default) {
NSLog("Tap Third Button!!!")
}
action3.buttonColor = UIColor.yellowColor()
actionSheet.addAction(action3)
let cancelAction = ANAction(title: "Cancel", style: .Cancel)
cancelAction.labelColor = UIColor.redColor()
actionSheet.addAction(cancelAction)
actionSheet.show()
nohirap, [email protected]
ANActionSheet 可在 MIT 许可证的条款下使用。有关更多信息,请参阅 LICENSE 文件。