Skip to content

Commit 29d17c0

Browse files
committed
Refine demo custom layout
1 parent 4dcfea5 commit 29d17c0

File tree

3 files changed

+78
-31
lines changed

3 files changed

+78
-31
lines changed

Demo/Demo.xcworkspace/xcuserdata/wtmoose.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,26 @@
22
<Bucket
33
type = "0"
44
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "Yes"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "Yes"
12+
symbolName = "UIApplicationMain"
13+
moduleName = "">
14+
<Actions>
15+
<BreakpointActionProxy
16+
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
17+
<ActionContent
18+
consoleCommand = "expr (Class)NSClassFromString(@&quot;IBARevealLoader&quot;) == nil ? (void *)dlopen(&quot;/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib&quot;, 0x2) : ((void*)0)">
19+
</ActionContent>
20+
</BreakpointActionProxy>
21+
</Actions>
22+
<Locations>
23+
</Locations>
24+
</BreakpointContent>
25+
</BreakpointProxy>
26+
</Breakpoints>
527
</Bucket>

Demo/Demo/TacoDialogView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import SwiftMessages
1212
class TacoDialogView: MessageView {
1313

1414
private static var tacoTitles = [
15-
1 : "One, Please",
15+
1 : "Just one, Please",
1616
2 : "Make it two!",
1717
3 : "Three!!!",
18+
4 : "Cuatro!!!!",
1819
]
1920

2021
var getTacosAction: ((count: Int) -> Void)?
@@ -23,7 +24,7 @@ class TacoDialogView: MessageView {
2324
private var count = 1 {
2425
didSet {
2526
iconLabel?.text = String(count: count, repeatedValue: "🌮" as Character)
26-
titleLabel?.text = TacoDialogView.tacoTitles[count]
27+
titleLabel?.text = TacoDialogView.tacoTitles[count] ?? "\(count)" + String(count: count, repeatedValue: "!" as Character)
2728
}
2829
}
2930

Demo/Demo/TacoDialogView.xib

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,84 @@
99
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
1010
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
1111
<view contentMode="scaleToFill" id="JI3-gM-XBO" userLabel="Card View" customClass="TacoDialogView" customModule="Demo" customModuleProvider="target">
12-
<rect key="frame" x="0.0" y="0.0" width="600" height="318"/>
12+
<rect key="frame" x="0.0" y="0.0" width="600" height="309"/>
1313
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1414
<subviews>
1515
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dp3-Ae-zep" userLabel="Background view">
16-
<rect key="frame" x="18" y="18" width="572" height="290"/>
16+
<rect key="frame" x="18" y="18" width="572" height="281"/>
1717
<subviews>
18-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="RJH-Fp-YDa" userLabel="Content view">
19-
<rect key="frame" x="30" y="30" width="512" height="230"/>
18+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="RJH-Fp-YDa" userLabel="Content view">
19+
<rect key="frame" x="30" y="30" width="512" height="221"/>
2020
<subviews>
21-
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="yHw-VQ-BjX">
22-
<rect key="frame" x="0.0" y="0.0" width="512" height="62"/>
21+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Irk-mj-bK8">
22+
<rect key="frame" x="0.0" y="0.0" width="512" height="60"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="748" text="🌮" textAlignment="right" lineBreakMode="characterWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="pFx-Py-lZQ" userLabel="Icon label">
25-
<rect key="frame" x="0.0" y="4" width="183.5" height="54"/>
26-
<fontDescription key="fontDescription" type="system" pointSize="45"/>
27-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
28-
<nil key="highlightedColor"/>
29-
</label>
30-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" text="One, please." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YAk-Zs-x2f">
31-
<rect key="frame" x="193.5" y="20" width="318.5" height="22"/>
32-
<fontDescription key="fontDescription" name="Futura-CondensedMedium" family="Futura" pointSize="18"/>
33-
<color key="textColor" red="0.6705882352941176" green="0.51372549019607838" blue="0.13333333333333333" alpha="1" colorSpace="calibratedRGB"/>
34-
<nil key="highlightedColor"/>
35-
</label>
24+
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" alignment="center" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="aav-a1-ogq">
25+
<rect key="frame" x="179" y="0.0" width="154" height="60"/>
26+
<subviews>
27+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xLT-bX-GJE">
28+
<rect key="frame" x="0.0" y="0.0" width="154" height="60"/>
29+
<subviews>
30+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="748" text="🌮" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="pFx-Py-lZQ" userLabel="Icon label">
31+
<rect key="frame" x="0.0" y="0.0" width="45" height="60"/>
32+
<constraints>
33+
<constraint firstAttribute="height" constant="60" id="6yp-AT-q9O"/>
34+
</constraints>
35+
<fontDescription key="fontDescription" type="system" pointSize="45"/>
36+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
37+
<nil key="highlightedColor"/>
38+
</label>
39+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Just one, please." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YAk-Zs-x2f">
40+
<rect key="frame" x="60" y="0.0" width="94" height="60"/>
41+
<fontDescription key="fontDescription" name="Futura-CondensedMedium" family="Futura" pointSize="18"/>
42+
<color key="textColor" red="0.6705882352941176" green="0.51372549019607838" blue="0.13333333333333333" alpha="1" colorSpace="calibratedRGB"/>
43+
<nil key="highlightedColor"/>
44+
</label>
45+
</subviews>
46+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
47+
<constraints>
48+
<constraint firstItem="YAk-Zs-x2f" firstAttribute="leading" secondItem="pFx-Py-lZQ" secondAttribute="trailing" constant="15" id="0za-KZ-w39"/>
49+
<constraint firstAttribute="bottom" secondItem="YAk-Zs-x2f" secondAttribute="bottom" id="5TB-rj-159"/>
50+
<constraint firstItem="pFx-Py-lZQ" firstAttribute="top" secondItem="xLT-bX-GJE" secondAttribute="top" id="Qeo-0t-HzA"/>
51+
<constraint firstAttribute="bottom" secondItem="pFx-Py-lZQ" secondAttribute="bottom" id="Qxn-hu-B7m"/>
52+
<constraint firstAttribute="height" constant="60" id="Y1Y-No-jwq"/>
53+
<constraint firstItem="pFx-Py-lZQ" firstAttribute="leading" secondItem="xLT-bX-GJE" secondAttribute="leading" id="htv-Kw-h9G"/>
54+
<constraint firstAttribute="trailing" secondItem="YAk-Zs-x2f" secondAttribute="trailing" id="u4s-eT-wmG"/>
55+
<constraint firstItem="YAk-Zs-x2f" firstAttribute="top" secondItem="xLT-bX-GJE" secondAttribute="top" id="y1I-oh-uhx"/>
56+
</constraints>
57+
</view>
58+
</subviews>
59+
</stackView>
3660
</subviews>
3761
</stackView>
38-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="748" text="How many tocos would you like?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMT-Vh-S3z">
39-
<rect key="frame" x="0.0" y="72" width="512" height="27"/>
62+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="748" misplaced="YES" text="How many tocos would you like?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMT-Vh-S3z">
63+
<rect key="frame" x="0.0" y="74" width="512" height="24"/>
4064
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
4165
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="18"/>
4266
<color key="textColor" red="0.40392156862745099" green="0.36862745098039218" blue="0.2627450980392157" alpha="1" colorSpace="calibratedRGB"/>
4367
<nil key="highlightedColor"/>
4468
</label>
45-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Adjust the taco slider and place your order." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U9w-CI-YK7">
46-
<rect key="frame" x="0.0" y="109" width="512" height="19.5"/>
69+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Adjust the taco slider and place your order." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U9w-CI-YK7">
70+
<rect key="frame" x="0.0" y="111" width="512" height="17"/>
4771
<fontDescription key="fontDescription" name="Futura-CondensedMedium" family="Futura" pointSize="14"/>
4872
<color key="textColor" red="0.60392156862745094" green="0.44313725490196076" blue="0.10588235294117647" alpha="1" colorSpace="calibratedRGB"/>
4973
<nil key="highlightedColor"/>
5074
</label>
51-
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="1" maxValue="6" translatesAutoresizingMaskIntoConstraints="NO" id="MKs-Kv-aPL">
52-
<rect key="frame" x="-2" y="138.5" width="516" height="35.5"/>
75+
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="1" maxValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="MKs-Kv-aPL">
76+
<rect key="frame" x="-2" y="142" width="516" height="31"/>
5377
<color key="minimumTrackTintColor" red="0.94509803921568625" green="0.57647058823529407" blue="0.078431372549019607" alpha="1" colorSpace="calibratedRGB"/>
5478
<connections>
5579
<action selector="tacoSliderSlided:" destination="JI3-gM-XBO" eventType="valueChanged" id="ABc-u9-Vpu"/>
5680
</connections>
5781
</slider>
5882
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="bottom" translatesAutoresizingMaskIntoConstraints="NO" id="x8I-RG-nBX">
59-
<rect key="frame" x="0.0" y="183" width="512" height="47"/>
83+
<rect key="frame" x="0.0" y="185" width="512" height="36"/>
6084
<subviews>
6185
<stackView opaque="NO" contentMode="scaleToFill" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="8Qt-TE-nPO">
62-
<rect key="frame" x="355" y="0.0" width="157" height="47"/>
86+
<rect key="frame" x="355" y="0.0" width="157" height="36"/>
6387
<subviews>
6488
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yFi-Ik-klX">
65-
<rect key="frame" x="0.0" y="0.0" width="58" height="47"/>
89+
<rect key="frame" x="0.0" y="0.0" width="58" height="36"/>
6690
<fontDescription key="fontDescription" type="system" pointSize="15"/>
6791
<state key="normal" title="Forget It">
6892
<color key="titleColor" red="0.94468559679999997" green="0.57750775359999995" blue="0.07530619559" alpha="1" colorSpace="calibratedRGB"/>
@@ -72,7 +96,7 @@
7296
</connections>
7397
</button>
7498
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rVu-Ei-t6A">
75-
<rect key="frame" x="73" y="0.0" width="84" height="47"/>
99+
<rect key="frame" x="73" y="0.0" width="84" height="36"/>
76100
<color key="backgroundColor" red="0.94117647058823528" green="0.57647058823529407" blue="0.074509803921568626" alpha="1" colorSpace="calibratedRGB"/>
77101
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="15"/>
78102
<inset key="contentEdgeInsets" minX="8" minY="8" maxX="8" maxY="8"/>
@@ -133,7 +157,7 @@
133157
<outlet property="tacoSlider" destination="MKs-Kv-aPL" id="Iky-UQ-58E"/>
134158
<outlet property="titleLabel" destination="YAk-Zs-x2f" id="ufT-ii-FoC"/>
135159
</connections>
136-
<point key="canvasLocation" x="360" y="430"/>
160+
<point key="canvasLocation" x="360" y="627.5"/>
137161
</view>
138162
</objects>
139163
</document>

0 commit comments

Comments
 (0)