diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..222e8ec --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Mac OS X +.DS_Store + +# Xcode + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +.build/ + +# Carthage +Carthage/Build diff --git a/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 0ab3779..0000000 Binary files a/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 7d075d8..0e54392 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -139,11 +139,11 @@ public extension TableDirector { } func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - return sections[section].headerHeight + return sections[section].headerView?.frame.size.height ?? UITableViewAutomaticDimension } - + func tableView(tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - return sections[section].footerHeight + return sections[section].footerView?.frame.size.height ?? UITableViewAutomaticDimension } } diff --git a/Tablet/TableSectionBuilder.swift b/Tablet/TableSectionBuilder.swift index 30a532e..4bb0d68 100644 --- a/Tablet/TableSectionBuilder.swift +++ b/Tablet/TableSectionBuilder.swift @@ -34,10 +34,7 @@ public class TableSectionBuilder { public var footerTitle: String? public var headerView: UIView? - public var headerHeight: CGFloat = UITableViewAutomaticDimension - public var footerView: UIView? - public var footerHeight: CGFloat = UITableViewAutomaticDimension /// A total number of rows in section of each row builder. public var numberOfRowsInSection: Int { @@ -54,13 +51,10 @@ public class TableSectionBuilder { } } - public init(headerView: UIView? = nil, headerHeight: CGFloat = UITableViewAutomaticDimension, footerView: UIView? = nil, footerHeight: CGFloat = UITableViewAutomaticDimension) { + public init(headerView: UIView? = nil, footerView: UIView? = nil) { self.headerView = headerView - self.headerHeight = headerHeight - self.footerView = footerView - self.footerHeight = footerHeight } // MARK: Public diff --git a/Tests/TabletTests.swift b/Tests/TabletTests.swift index 2d9136e..0cbe395 100644 --- a/Tests/TabletTests.swift +++ b/Tests/TabletTests.swift @@ -157,7 +157,7 @@ class TabletTests: XCTestCase { let sectionHeaderView = UIView() let sectionFooterView = UIView() - let section = TableSectionBuilder(headerView: sectionHeaderView, headerHeight: 44, footerView: sectionFooterView, footerHeight: 44) + let section = TableSectionBuilder(headerView: sectionHeaderView, footerView: sectionFooterView) section += row testController.view.hidden = false