From 8509c8d64e3095ca6b708ceb6ff12115eb58a511 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Mon, 13 Jun 2016 01:07:46 +0300 Subject: [PATCH] bump readme --- README.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4b452c..ec0f076 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ Build Status Swift 2.2 compatible Platform iOS -CocoaPods compatible +CocoaPods compatible License: MIT

-TableKit is a super lightweight yet powerful generic library that handles a complexity of UITableView's datasource and delegate methods in a Swift environment. Tablet's goal is to provide an easiest way to create complex table views. With Tablet you don't have to write a messy code of `switch` or `if` statements when you deal with bunch of different cells in different sections. +TableKit is a super lightweight yet powerful generic library that handles a complexity of UITableView's datasource and delegate methods in a Swifty way. TableKit's goal is to provide the easiest way to create complex table views. With TableKit you don't have to write a messy code of `switch` or `if` statements when you deal with bunch of different cells in different sections. ## Features @@ -22,8 +22,40 @@ TableKit is a super lightweight yet powerful generic library that handles a comp - [x] Extensibility - [x] Tests -Docs will be updated soon. +## Usage + +Create your rows: +```swift +let row1 = TableRow(item: "1") +let row2 = TableRow(item: 2) +let row3 = TableRow(item: 3.0) +``` +Put rows into section: +```swift +let s = TableSection(rows: [row1, row2, row3]) +``` +And configure your table: +```swift +let tableDirector = TableDirector(tableView: tableView) +tableDirector += section +``` +Done. Your table is ready. You may want to look at your cell. It has to conform to ConfigurableCell protocol: +```swift +class StringTableViewCell: UITableViewCell, ConfigurableCell { + + typealias T = String + + func configure(string: T) { + titleLabel.text = string + } + + static func estimatedHeight() -> CGFloat { + return 44 + } +} +``` + ## License -Tablet is available under the MIT license. See LICENSE for details. \ No newline at end of file +TableKit is available under the MIT license. See LICENSE for details. \ No newline at end of file