Skip to content

Commit 418a545

Browse files
committed
Make minimised view more meaningful and add a button to update it.
1 parent d109145 commit 418a545

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

SampleSporify/SampleChildViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ class SampleChildViewController: UIViewController, Expandable {
2626
@IBAction func collapseFromExpandedTapped(_ sender: Any) {
2727
expander?.collapseCollapsibleViewController()
2828
}
29+
@IBAction func updateMinimisedViewTapped(_ sender: Any) {
30+
collapsedStateView.backgroundColor = .red
31+
}
2932
}

SampleSporify/SampleChildViewController.xib

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,20 @@
3838
</label>
3939
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BiF-D1-eME">
4040
<rect key="frame" x="0.0" y="44" width="414" height="50"/>
41-
<color key="backgroundColor" systemColor="systemGreenColor" red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
41+
<subviews>
42+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tap to expand" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sg8-bV-XqH">
43+
<rect key="frame" x="20" y="14.5" width="374" height="21"/>
44+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
45+
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
46+
<nil key="highlightedColor"/>
47+
</label>
48+
</subviews>
49+
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4250
<constraints>
51+
<constraint firstAttribute="trailing" secondItem="sg8-bV-XqH" secondAttribute="trailing" constant="20" symbolic="YES" id="3FP-eK-XD1"/>
4352
<constraint firstAttribute="height" constant="50" id="d8e-J2-U8u"/>
53+
<constraint firstItem="sg8-bV-XqH" firstAttribute="leading" secondItem="BiF-D1-eME" secondAttribute="leading" constant="20" symbolic="YES" id="taS-cy-ScV"/>
54+
<constraint firstItem="sg8-bV-XqH" firstAttribute="centerY" secondItem="BiF-D1-eME" secondAttribute="centerY" id="xW2-KN-8Qv"/>
4455
</constraints>
4556
</view>
4657
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A3p-MX-5B5">
@@ -53,17 +64,30 @@
5364
<action selector="collapseFromExpandedTapped:" destination="-1" eventType="touchUpInside" id="pu6-hm-LEw"/>
5465
</connections>
5566
</button>
67+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gpe-Bg-aEe">
68+
<rect key="frame" x="0.0" y="375.5" width="414" height="30"/>
69+
<constraints>
70+
<constraint firstAttribute="height" constant="30" id="bWm-SI-YFq"/>
71+
</constraints>
72+
<state key="normal" title="Update minimised view"/>
73+
<connections>
74+
<action selector="updateMinimisedViewTapped:" destination="-1" eventType="touchUpInside" id="GBG-2b-Xsh"/>
75+
</connections>
76+
</button>
5677
</subviews>
5778
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
5879
<constraints>
5980
<constraint firstItem="A3p-MX-5B5" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="1BH-aH-k96"/>
81+
<constraint firstItem="gpe-Bg-aEe" firstAttribute="top" secondItem="A3p-MX-5B5" secondAttribute="bottom" constant="16" id="4rD-dO-rfW"/>
6082
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="A3p-MX-5B5" secondAttribute="trailing" id="81H-hN-2sR"/>
6183
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="BiF-D1-eME" secondAttribute="trailing" id="8nQ-Jn-rW4"/>
84+
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="gpe-Bg-aEe" secondAttribute="trailing" id="C9l-qW-0uB"/>
6285
<constraint firstItem="c05-Pg-lk2" firstAttribute="top" secondItem="ZlO-Kr-tty" secondAttribute="bottom" constant="16" id="D1L-Uw-hPE"/>
6386
<constraint firstItem="BiF-D1-eME" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="EY6-VI-g6S"/>
6487
<constraint firstItem="BiF-D1-eME" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="EmV-oQ-AJC"/>
6588
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="c05-Pg-lk2" secondAttribute="trailing" id="Ls6-wX-8UE"/>
6689
<constraint firstItem="A3p-MX-5B5" firstAttribute="top" secondItem="c05-Pg-lk2" secondAttribute="bottom" constant="16" id="OZ7-eU-rEa"/>
90+
<constraint firstItem="gpe-Bg-aEe" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="R0b-Yz-Nvu"/>
6791
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ZlO-Kr-tty" secondAttribute="trailing" id="UJO-bg-cCJ"/>
6892
<constraint firstItem="ZlO-Kr-tty" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="VjF-YK-yFj"/>
6993
<constraint firstItem="c05-Pg-lk2" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="dr1-Ot-TAw"/>

0 commit comments

Comments
 (0)