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

大话设计模式

大话设计模式

程杰 / 清华大学出版社 / 2007-12-1 / 45.00元

本书通篇都是以情景对话的形式,用多个小故事或编程示例来组织讲解GOF(设计模式的经典名著——Design Patterns:Elements of Reusable Object-Oriented Software,中译本名为《设计模式——可复用面向对象软件的基础》的四位作者EIich Gamma、Richard Helm、Ralph Johnson,以及John Vlissides,这四人常被称......一起来看看 《大话设计模式》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具