ActionSheetController
ActionSheetController 是一个类似 AlertController 的 ActionSheet 控制器
看起来什么样?
如何使用?
let controller = ActionSheetController(cancelTitleColor: UIColor.blueColor())
let titles = ["发送给胖友", "收藏", "保存图片", "定位到聊天位置", "分享到微博", "复制链接", "复制图片"]
titles.forEach { (title) -> () in
let action = SheetAction(title: title, handler: { (sender: SheetAction) -> Void in
debugPrint("Taped: \(sender.title)")
})
controller.addAction(action)
}
let action = SheetAction(title: "Plus", titleColor: UIColor.redColor())
controller.addAction(action)
presentViewController(controller, animated: true, completion: nil)
注意
- v0.x for swift 2.2
- v1.x for swift2.3
- v2.x for swift3.x
- v3.x for swift4.x