diff --git a/Tablet.podspec b/Tablet.podspec index 373dac0..9f4c619 100644 --- a/Tablet.podspec +++ b/Tablet.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Tablet' - s.version = '0.2.6' + s.version = '0.2.7' s.homepage = 'https://github.com/maxsokolov/tablet' s.summary = 'Powerful type-safe tool for UITableView. Swift 2.0 is required.' diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 957b933..e8b64ee 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -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: kActionPerformedNotificationKey, object: nil) + NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(didReceiveAction), name: kActionPerformedNotificationKey, object: nil) } deinit { diff --git a/Tablet/TableRowBuilder.swift b/Tablet/TableRowBuilder.swift index 6a77c5c..a5b79f0 100644 --- a/Tablet/TableRowBuilder.swift +++ b/Tablet/TableRowBuilder.swift @@ -46,7 +46,7 @@ internal enum ActionHandler { public class TableRowBuilder : RowBuilder { private var actions = Dictionary>() - private var items = [I]() + public var items = [I]() public var reusableIdentifier: String public var estimatedRowHeight: CGFloat diff --git a/Tablet/TableSectionBuilder.swift b/Tablet/TableSectionBuilder.swift index 5912ff0..ffc77b6 100644 --- a/Tablet/TableSectionBuilder.swift +++ b/Tablet/TableSectionBuilder.swift @@ -67,13 +67,14 @@ public class TableSectionBuilder { internal extension TableSectionBuilder { - internal func builderAtIndex(var index: Int) -> (RowBuilder, Int)? { + internal 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 diff --git a/Tablet/Tablet.swift b/Tablet/Tablet.swift index ce40387..f0764e8 100644 --- a/Tablet/Tablet.swift +++ b/Tablet/Tablet.swift @@ -99,7 +99,7 @@ public class Action { */ public protocol ConfigurableCell { - typealias Item + associatedtype Item static func reusableIdentifier() -> String func configureWithItem(item: Item) diff --git a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate index ae39eeb..d52173a 100644 Binary files a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate and b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate differ