diff --git a/.travis.yml b/.travis.yml index a8a2efc..b570850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ language: objective-c osx_image: xcode7.2 +branches: + only: + - master before_install: - cd Tablet script: - - xctool clean build test -project Tablet.xcodeproj -scheme Tablet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES + - xctool clean build test -project Tablet.xcodeproj -scheme Tablet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES after_success: - - cd $TRAVIS_BUILD_DIR \ No newline at end of file + - cd $TRAVIS_BUILD_DIR \ No newline at end of file diff --git a/README.md b/README.md index 4dc8199..5ab6266 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,21 @@ Tablet 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. -That's almost all you need in your controller to build a bunch of cells in a section: +## Features + +- [x] Powerfull type-safe system based on generics +- [x] Chainable cell actions +- [x] Support cells created from code, xib, or storyboard +- [x] Automatic xib/classes registration +- [x] No need to subclass +- [x] Extensibility +- [x] Tests + +That's almost all you need in your controller to build a bunch of cells in a section 😘: ```swift -TableConfigurableRowBuilder(items: ["1", "2", "3", "4", "5"], estimatedRowHeight: 42) +TableConfigurableRowBuilder(items: ["1", "2", "3", "4", "5"]) ``` -Tablet respects cells reusability feature and it's type-safe. See the Usage section to learn more. +Tablet respects cells reusability feature and built with performace in mind. See the Usage section to learn more. ## Requirements @@ -78,6 +88,10 @@ class MyTableViewCell : UITableViewCell, ConfigurableCell { return "reusable_id" } + static func estimatedHeight() -> Float { + return 255 + } + func configureWithItem(item: Item) { // item is user here textLabel?.text = item.username @@ -90,7 +104,7 @@ Once you've implemented the protocol, simply use the `TableConfigurableRowBuilde ```swift import Tablet -let rowBuilder = TableConfigurableRowBuilder(estimatedRowHeight: 42) +let rowBuilder = TableConfigurableRowBuilder() rowBuilder.appendItems(users) director = TableDirector(tableView: tableView) @@ -135,7 +149,7 @@ And receive this actions with your row builder: ```swift import Tablet -let rowBuilder = TableConfigurableRowBuilder(items: users, id: "reusable_id", estimatedRowHeight: 42) +let rowBuilder = TableConfigurableRowBuilder(items: users, id: "reusable_id") .action(.click) { data -> Void in } @@ -166,7 +180,7 @@ extension TableDirector { ``` Catch your action with row builder: ```swift -let rowBuilder = TableConfigurableRowBuilder(items: users, estimatedRowHeight: 42) +let rowBuilder = TableConfigurableRowBuilder(items: users) .action(kTableDirectorDidEndDisplayingCell) { data -> Void in } diff --git a/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate index 71cef90..b0f72cb 100644 Binary files a/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate and b/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate index 947d532..7f71110 100644 Binary files a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate and b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ