ANActionSheet 0.1.5

ANActionSheet 0.1.5

测试兼容性测试
语言支持的编程语言 SwiftSwift
许可证 MIT
发布日期最新发布日期2016年6月
SPM支持 Swift Package Manager (SPM)

nohirap 维护。



  • 作者:
  • nohirap

ANActionSheet

屏幕截图

image_alt_text

示例

要运行示例项目,请克隆仓库,然后先从 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 文件。