DMActionController
DMActionController 是一个可定制的动作表,其 API 基于UIKit的UIAlertController。
用法
如果想要尝试它,只需运行
pod try DMActionController
- 显示动作控制器非常简单,例如
let actionSheet = DMActionController(title: "My Action Sheet", message: "This is an action sheet.", preferredStyle: .table)
actionSheet.addAction(DMAction(title: "Do Action", style: .default, handler: { _ in
NSLog("The user tapped \"Do Action\" in the action sheet.")
}))
self.present(actionSheet, animated: true, completion: nil)
示例
表格样式 | 集合样式 |
---|---|
![]() |
![]() |
![]() |
![]() |
安装
DMActionController 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'DMActionController'
许可
DMActionController可在MIT许可下使用。更多信息请参阅LICENSE文件。