Merge pull request #38 from maxsokolov/develop
Support insert many rows in section
This commit is contained in:
commit
7a310f6db2
|
|
@ -4,7 +4,7 @@
|
|||
<a href="https://travis-ci.org/maxsokolov/TableKit"><img src="https://api.travis-ci.org/maxsokolov/TableKit.svg" alt="Build Status" /></a>
|
||||
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/Swift_2.2-compatible-4BC51D.svg?style=flat" alt="Swift 2.2 compatible" /></a>
|
||||
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible" /></a>
|
||||
<a href="https://cocoapods.org/pods/tablekit"><img src="https://img.shields.io/badge/pod-1.1.0-blue.svg" alt="CocoaPods compatible" /></a>
|
||||
<a href="https://cocoapods.org/pods/tablekit"><img src="https://img.shields.io/badge/pod-1.1.1-blue.svg" alt="CocoaPods compatible" /></a>
|
||||
<img src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" alt="Platform iOS" />
|
||||
<a href="https://raw.githubusercontent.com/maxsokolov/tablekit/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" alt="License: MIT" /></a>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.'
|
||||
|
|
|
|||
Loading…
Reference in New Issue