support swift 2.2

This commit is contained in:
Max Sokolov 2016-03-22 21:28:23 +03:00
parent 47410ea182
commit f0afd40e5a
5 changed files with 8 additions and 6 deletions

View File

@ -32,6 +32,7 @@ Tablet respects cells reusability feature and built with performace in mind. See
- iOS 8.0+
- Xcode 7.0+
- Swift 2.2
## Installation

View File

@ -37,7 +37,7 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate
self.tableView.delegate = self
self.tableView.dataSource = self
NSNotificationCenter.defaultCenter().addObserver(self, selector: "didReceiveAction:", name: TabletNotifications.CellAction, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(didReceiveAction), name: TabletNotifications.CellAction, object: nil)
}
deinit {

View File

@ -81,13 +81,14 @@ public class TableSectionBuilder {
// MARK: Internal
func builderAtIndex(var index: Int) -> (RowBuilder, Int)? {
func builderAtIndex(index: Int) -> (RowBuilder, Int)? {
var builderIndex = index
for builder in builders {
if index < builder.numberOfRows {
return (builder, index)
if builderIndex < builder.numberOfRows {
return (builder, builderIndex)
}
index -= builder.numberOfRows
builderIndex -= builder.numberOfRows
}
return nil

View File

@ -102,7 +102,7 @@ public class Action {
*/
public protocol ConfigurableCell {
typealias Item
associatedtype Item
static func reusableIdentifier() -> String
static func estimatedHeight() -> Float