UITableView 管理方法 Hakuba

码农软件 · 软件分类 · 列表(Table) · 2019-05-25 13:29:39

软件介绍

Hakuba 是管理 UITableView 的新方式。

代码示例

 // viewController swift file
    hakuba = Hakuba(tableView: tableView)
    let cellmodel = YourCellModel(title: "Title", des: "description") {
        println("Did select cell with title = \(title)")
    }
    hakuba[2].append(cellmodel)     // append a new cell model in datasource
             .slide(.Fade)          // show the cell of your cell model in the table view
    hakuba[1].remove(1...3)
             .slide(.Right)
// your cell swift file
    class YourCellModel : MYCellModel {
        let title: String
        let des: String
        init(title: String, des: String, selectionHandler: MYSelectionHandler) {
            self.title = title
            self.des = des
            super.init(YourCell.self, selectionHandler: selectionHandler)
        }
    }
    class YourCell : MYTableViewCell {
        @IBOutlet weak var titleLabel: UILabel!
        override func configureCell(data: MYCellModel) {
            super.configureCell(data)
            if let cellmodel = data as? YourCellModel {
                titleLabel.text = cellmodel.title
            }
        }
    }


本文地址:https://codercto.com/soft/d/6514.html

未来医疗

未来医疗

【美】埃里克•托普 (Eric Topol) / 郑杰 / 浙江人民出版社 / 2016-5 / 69.90

在传统医学中,医生是上帝,是权威,拥有至高无上的解释权和裁决权,面对疾病,患者总是被动接受,为医命是从。而在大数据时代下,医疗领域将发生颠覆性的变化,以患者为中心的民主医疗时代即将到来。 享誉全美的医疗预言家埃里克•托普在《未来医疗》中,为我们展示了医疗领域创新的憧憬, 分析了在开放的智能时代中,无线医疗技术将从医疗服务、医患关系上颠覆自古以来的家长式医疗,实现“以患者为中心”的个体医疗革命......一起来看看 《未来医疗》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具