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