Hakuba UITableView 管理方法

程序名称:Hakuba

Hakuba 介绍

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
            }
        }
    }

Hakuba 官网

https://github.com/nghialv/Hakuba

相关编程语言

Acapela TTS 是一个为 iPhone 和 iPad 开发的 TTS 引...
二维码(QR Code)扫描静态库,扫描效率较高。
RegexKitLite 是一个轻量级的 Objective-C 的正则表...
一款基于ASIHttpReques开源的仿迅雷多线程断点续传功...
实现动态检测网络(wifi)状况,不需要用户手动刷新...
使用iphoneSDK官方NSXMLParserDelegate做的简单xml解...