From 155524f13c0e10d02541e79fc3cd0ef93625ba31 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Tue, 30 Aug 2016 13:45:34 +0300 Subject: [PATCH 1/3] support insert many rows in section --- Sources/TableDirector.swift | 1 - Sources/TableSection.swift | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/TableDirector.swift b/Sources/TableDirector.swift index 81b8b5d..6f7c093 100644 --- a/Sources/TableDirector.swift +++ b/Sources/TableDirector.swift @@ -230,7 +230,6 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate public func append(sections sections: [TableSection]) -> Self { - sections.forEach { $0.tableDirector = self } self.sections.appendContentsOf(sections) return self } diff --git a/Sources/TableSection.swift b/Sources/TableSection.swift index 3e4df1d..41d34d3 100644 --- a/Sources/TableSection.swift +++ b/Sources/TableSection.swift @@ -21,9 +21,7 @@ import UIKit public class TableSection { - - weak var tableDirector: TableDirector? - + public private(set) var rows = [Row]() public var headerTitle: String? @@ -78,10 +76,14 @@ public class TableSection { self.rows.appendContentsOf(rows) } - public func insert(row row: Row, atIndex index: Int) { + public func insert(row row: Row, at index: Int) { rows.insert(row, atIndex: index) } + public func insert(rows rows: [Row], at index: Int) { + self.rows.insertContentsOf(rows, at: index) + } + public func delete(index index: Int) { rows.removeAtIndex(index) } From ddced231c3f811001541534abd5157e7cee08678 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Tue, 30 Aug 2016 13:45:52 +0300 Subject: [PATCH 2/3] bump podspec --- TableKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TableKit.podspec b/TableKit.podspec index e688275..1233c34 100644 --- a/TableKit.podspec +++ b/TableKit.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'TableKit' s.module_name = 'TableKit' - s.version = '1.1.0' + s.version = '1.1.1' s.homepage = 'https://github.com/maxsokolov/TableKit' s.summary = 'Type-safe declarative table views. Swift 2.2 is required.' From 9a50eba12e6128433dd2ba1f66c11e7ef4eb2d04 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Tue, 30 Aug 2016 13:46:09 +0300 Subject: [PATCH 3/3] bump readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd5aa86..b5e963b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build Status Swift 2.2 compatible Carthage compatible - CocoaPods compatible + CocoaPods compatible Platform iOS License: MIT