From d5639127f2986caf796f9550457477687edb7263 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Sun, 8 Nov 2015 15:55:06 +0300 Subject: [PATCH] bump readme --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 240f65f..a23f7e4 100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -# Tablet \ No newline at end of file +# tablet + +Tablet is a super lightweight yet powerful library that handles a complexity of UITableView's datasource and delegate. + +## Requirements + +- iOS 7.0+ +- Xcode 7.0+ + +## Usage + +### Very basic + +```swift +import Tablet + +let rowBuilder = TableRowBuilder(items: [user1, user2, user3], id: "reusable_id") + .action(.configure) { data in + + data.cell.textLabel?.text = data.item.title + data.cell.detailTextLabel?.text = data.item.isActive ? "Active" : "Inactive" + } + +let sectionBuilder = TableSectionBuilder(headerTitle: "Users", rowBuilders: [rowBuilder]) + +let director = TableDirector(tableView: tableView) +director.appendSections(sectionBuilder) +``` + +### Additional cell actions + +```swift + +let rowBuilder = TableRowBuilder(items: [user1, user2, user3], id: "reusable_id") + .action(.configure) { data in + + } + .action(.click) { data in + + } + .action(.willDisplay) { data in + + } +``` \ No newline at end of file