Skip to content

Commit 45cfb0d

Browse files
committed
Adjust label stack view to support center alignment
1 parent c0d69ee commit 45cfb0d

File tree

4 files changed

+33
-41
lines changed

4 files changed

+33
-41
lines changed

SwiftMessages/Resources/CardView.xib

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3-
<device id="retina6_1" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment version="2320" identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<objects>
@@ -31,13 +29,13 @@
3129
<nil key="highlightedColor"/>
3230
</label>
3331
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="RxA-tv-YM7" userLabel="Icon image view">
34-
<rect key="frame" x="53" y="13" width="16" height="16"/>
32+
<rect key="frame" x="53" y="0.0" width="66" height="42"/>
3533
</imageView>
36-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="i9r-ex-CgT">
37-
<rect key="frame" x="79" y="2" width="284" height="38.5"/>
34+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="i9r-ex-CgT">
35+
<rect key="frame" x="129" y="2" width="234" height="38.5"/>
3836
<subviews>
3937
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="[Title]" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8HR-oh-U9F">
40-
<rect key="frame" x="0.0" y="0.0" width="48.5" height="20.5"/>
38+
<rect key="frame" x="0.0" y="0.0" width="234" height="20.5"/>
4139
<accessibility key="accessibilityConfiguration">
4240
<bool key="isElement" value="NO"/>
4341
</accessibility>
@@ -46,7 +44,7 @@
4644
<nil key="highlightedColor"/>
4745
</label>
4846
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="[Message Body]" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9oc-qg-igL">
49-
<rect key="frame" x="0.0" y="20.5" width="112" height="18"/>
47+
<rect key="frame" x="0.0" y="20.5" width="234" height="18"/>
5048
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
5149
<accessibility key="accessibilityConfiguration">
5250
<bool key="isElement" value="NO"/>

SwiftMessages/Resources/CenteredView.xib

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3-
<device id="retina6_1" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment version="2320" identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15508"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<objects>
@@ -31,7 +29,7 @@
3129
<nil key="highlightedColor"/>
3230
</label>
3331
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="700" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="hUK-sr-A3U" userLabel="Icon image view">
34-
<rect key="frame" x="169" y="55.5" width="16" height="0.0"/>
32+
<rect key="frame" x="144" y="55.5" width="66" height="0.0"/>
3533
</imageView>
3634
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="700" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="[Title]" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ggW-gB-SWF">
3735
<rect key="frame" x="153" y="65.5" width="48.5" height="20.5"/>

SwiftMessages/Resources/MessageView.xib

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3-
<device id="retina6_1" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment version="2320" identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15508"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<objects>
1210
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
1311
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
1412
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MessageView" customModule="SwiftMessages">
15-
<rect key="frame" x="0.0" y="0.0" width="600" height="103"/>
13+
<rect key="frame" x="0.0" y="0.0" width="600" height="154"/>
1614
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1715
<subviews>
1816
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="Nx9-Zd-fca">
19-
<rect key="frame" x="20" y="44" width="560" height="25"/>
17+
<rect key="frame" x="20" y="44" width="560" height="76"/>
2018
<subviews>
2119
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" text="😬" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Bu-DY-qZo" userLabel="Icon label">
22-
<rect key="frame" x="0.0" y="0.0" width="43" height="25"/>
20+
<rect key="frame" x="0.0" y="15.5" width="43" height="45.5"/>
2321
<accessibility key="accessibilityConfiguration">
2422
<bool key="isElement" value="NO"/>
2523
</accessibility>
@@ -28,13 +26,13 @@
2826
<nil key="highlightedColor"/>
2927
</label>
3028
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="PbA-QP-XpA" userLabel="Icon image view">
31-
<rect key="frame" x="53" y="4.5" width="16" height="16"/>
29+
<rect key="frame" x="53" y="4" width="66" height="68"/>
3230
</imageView>
33-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="MKC-Mf-yZN">
34-
<rect key="frame" x="79" y="0.0" width="414" height="25"/>
31+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="MKC-Mf-yZN">
32+
<rect key="frame" x="129" y="16.5" width="364" height="43.5"/>
3533
<subviews>
3634
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="[Title]" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8T6-4T-ytS">
37-
<rect key="frame" x="0.0" y="0.0" width="48.5" height="20"/>
35+
<rect key="frame" x="0.0" y="0.0" width="364" height="20.5"/>
3836
<accessibility key="accessibilityConfiguration">
3937
<bool key="isElement" value="NO"/>
4038
</accessibility>
@@ -43,7 +41,7 @@
4341
<nil key="highlightedColor"/>
4442
</label>
4543
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="[Message Body]" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dFP-4Z-N2a">
46-
<rect key="frame" x="0.0" y="25" width="112" height="0.0"/>
44+
<rect key="frame" x="0.0" y="25.5" width="364" height="18"/>
4745
<accessibility key="accessibilityConfiguration">
4846
<bool key="isElement" value="NO"/>
4947
</accessibility>
@@ -55,7 +53,7 @@
5553
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
5654
</stackView>
5755
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" horizontalCompressionResistancePriority="752" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VCW-IQ-FfQ">
58-
<rect key="frame" x="503" y="0.0" width="57" height="25"/>
56+
<rect key="frame" x="503" y="23" width="57" height="30"/>
5957
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
6058
<state key="normal" title="[Button]"/>
6159
</button>
@@ -97,7 +95,7 @@
9795
<outlet property="iconLabel" destination="1Bu-DY-qZo" id="PWN-yD-bZu"/>
9896
<outlet property="titleLabel" destination="8T6-4T-ytS" id="ZfL-Z3-Gk0"/>
9997
</connections>
100-
<point key="canvasLocation" x="360" y="352.5"/>
98+
<point key="canvasLocation" x="359.4202898550725" y="334.15178571428572"/>
10199
</view>
102100
</objects>
103101
<resources>

SwiftMessages/Resources/TabView.xib

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3-
<device id="retina6_1" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment version="2320" identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15508"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<objects>
@@ -31,13 +29,13 @@
3129
<nil key="highlightedColor"/>
3230
</label>
3331
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="iJe-yo-EnG" userLabel="Icon image view">
34-
<rect key="frame" x="53" y="14.5" width="16" height="16"/>
32+
<rect key="frame" x="53" y="0.0" width="66" height="45"/>
3533
</imageView>
36-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="h4V-Az-Wau">
37-
<rect key="frame" x="79" y="3.5" width="374" height="38.5"/>
34+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="h4V-Az-Wau">
35+
<rect key="frame" x="129" y="3.5" width="324" height="38.5"/>
3836
<subviews>
3937
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="[Title]" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RxN-E1-uzx">
40-
<rect key="frame" x="0.0" y="0.0" width="48.5" height="20.5"/>
38+
<rect key="frame" x="0.0" y="0.0" width="324" height="20.5"/>
4139
<accessibility key="accessibilityConfiguration">
4240
<bool key="isElement" value="NO"/>
4341
</accessibility>
@@ -46,7 +44,7 @@
4644
<nil key="highlightedColor"/>
4745
</label>
4846
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="[Message Body]" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JoS-PU-kVw">
49-
<rect key="frame" x="0.0" y="20.5" width="112" height="18"/>
47+
<rect key="frame" x="0.0" y="20.5" width="324" height="18"/>
5048
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
5149
<accessibility key="accessibilityConfiguration">
5250
<bool key="isElement" value="NO"/>

0 commit comments

Comments
 (0)