Skip to content

Commit 819052a

Browse files
committed
Added cell screenshot and some code refactors.
1 parent 3e31cb4 commit 819052a

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

ios-swift-collapsible-table-section/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<rect key="frame" x="0.0" y="114" width="600" height="44"/>
1919
<autoresizingMask key="autoresizingMask"/>
2020
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zdz-3J-nqO" id="hRR-b8-2h9">
21-
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
21+
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
2222
<autoresizingMask key="autoresizingMask"/>
2323
<subviews>
2424
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zKO-kU-Djk">
@@ -59,7 +59,7 @@
5959
<rect key="frame" x="0.0" y="158" width="600" height="44"/>
6060
<autoresizingMask key="autoresizingMask"/>
6161
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="prF-yB-aLs" id="lc8-s4-UaK">
62-
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
62+
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
6363
<autoresizingMask key="autoresizingMask"/>
6464
</tableViewCellContentView>
6565
</tableViewCell>

ios-swift-collapsible-table-section/CollapsibleTableViewController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ class CollapsibleTableViewController: UITableViewController {
6868
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
6969
let header = tableView.dequeueReusableCellWithIdentifier("header") as! CollapsibleTableViewHeader
7070

71-
header.titleLabel.text = sections[section].name
7271
header.toggleButton.tag = section
73-
header.toggleButton.addTarget(self, action: #selector(CollapsibleTableViewController.toggleCollapse), forControlEvents: .TouchUpInside)
74-
72+
header.titleLabel.text = sections[section].name
7573
header.toggleButton.rotate(sections[section].collapsed! ? 0.0 : CGFloat(M_PI_2))
74+
header.toggleButton.addTarget(self, action: #selector(CollapsibleTableViewController.toggleCollapse), forControlEvents: .TouchUpInside)
7675

7776
return header.contentView
7877
}

screenshots/cell.png

22.7 KB
Loading

0 commit comments

Comments
 (0)