DynamicActionSheet 1.1.0

DynamicActionSheet 1.1.0

Andres Rojas 维护。



  • Andres Rojas,Daniel Cardona

DynamicActionSheet

Build Status Platform Compatible License

DynamicActionSheet 是一个库,可以快速创建任何自定义操作表控制器。

使用

// Instantiate custom action sheet controller
let list = DynamicActionSheet()
//Set up delegate and datasource
list.delegate = self
list.datasource = self
//You can use a custom button (this is optional)
list.showButton = true
// present actionSheet like any other view controller
self.present(list, animated: true)

代理 & 数据源

extension ViewController: ListViewDataSource, ListViewDelegate {
    func numberOfRows(for tableView: UITableView) -> Int {
        return 10
    }

    func dynamicSheet(_ actionCell: ActionTableViewCell, forItemAt index: Int) {
        actionCell.titleLabel.text = "Cell \(index)"
    }

    func didSelectMultipleIndexes(indexes: [Int]) {
        print("\(indexes.count) values selected")
    }

    var listTitle: String? {
        return "Title"
    }

    var buttonTitle: String? {
        return "All Items"
    }

    func dynamicSheet(didSelectRowAt index: Int) {
        print("row \(index) selected")
    }
}

开发

库正在建设中 想要贡献?太好了!请随意提交拉取请求

许可证

MIT 许可证

版权所有 © 2018 Andres Rojas

特此授予,任何人获得此软件及其关联文档副本(统称“软件”)的权利,自由使用软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本,以及允许向用户提供软件的人员进行此类操作的权利,但必须遵守以下条件:

所有副本或软件的实质性部分的副本中必须包含上述版权声明和本许可声明。

软件按“原样”提供,不提供任何形式的保证,无论是明示的还是暗示的,包括但不限于适用性、特定用途和侵权保证。在任何情况下,作者或版权所有者都不会对任何索赔、损害或其他责任承担责任,无论是由合同、侵权或任何其他原因引起,不论该索赔、损害或其他责任是否与软件有关、使用或其他方式与软件有关。

免费软件,万岁!”