Skip to content

Commit a12e067

Browse files
committed
Merge branch 'num42-fix_auto_layout_code'
2 parents fcbd59c + 600dae5 commit a12e067

File tree

4 files changed

+73
-8
lines changed

4 files changed

+73
-8
lines changed

Example/LicensesViewControllerExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
2BF95C661CB1325D00429D0B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BF95C651CB1325D00429D0B /* ViewController.swift */; };
2121
46A8AB6B9FD1CF785A33AFC0 /* Pods_iOS_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0148D52B6BD5A4B37F578EC9 /* Pods_iOS_Example.framework */; };
2222
6AAE3F78BF111CA20FE9A407 /* Pods_tvOS_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBFB1CFCE6CCAE6A13E22BC9 /* Pods_tvOS_Example.framework */; };
23-
F469521610C1E8BAF5D87B12 /* Pods_LicensesViewControllerExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF8350C95A27B05A6C77A2B7 /* Pods_LicensesViewControllerExample.framework */; };
2423
/* End PBXBuildFile section */
2524

2625
/* Begin PBXCopyFilesBuildPhase section */
@@ -55,7 +54,6 @@
5554
B47D0FB9514E3943F721201A /* Pods-iOS Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOS Example/Pods-iOS Example.debug.xcconfig"; sourceTree = "<group>"; };
5655
CA5191F110E4BEC5AD5F5E98 /* Pods-LicensesViewControllerExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LicensesViewControllerExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-LicensesViewControllerExample/Pods-LicensesViewControllerExample.release.xcconfig"; sourceTree = "<group>"; };
5756
DBFB1CFCE6CCAE6A13E22BC9 /* Pods_tvOS_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_tvOS_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
58-
EF8350C95A27B05A6C77A2B7 /* Pods_LicensesViewControllerExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LicensesViewControllerExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5957
FBC6D32D8AEEC122BE7E547C /* Pods-iOS Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOS Example/Pods-iOS Example.release.xcconfig"; sourceTree = "<group>"; };
6058
/* End PBXFileReference section */
6159

@@ -64,7 +62,6 @@
6462
isa = PBXFrameworksBuildPhase;
6563
buildActionMask = 2147483647;
6664
files = (
67-
F469521610C1E8BAF5D87B12 /* Pods_LicensesViewControllerExample.framework in Frameworks */,
6865
46A8AB6B9FD1CF785A33AFC0 /* Pods_iOS_Example.framework in Frameworks */,
6966
);
7067
runOnlyForDeploymentPostprocessing = 0;
@@ -83,7 +80,6 @@
8380
242CDB33F69894DAB0DC971B /* Frameworks */ = {
8481
isa = PBXGroup;
8582
children = (
86-
EF8350C95A27B05A6C77A2B7 /* Pods_LicensesViewControllerExample.framework */,
8783
0148D52B6BD5A4B37F578EC9 /* Pods_iOS_Example.framework */,
8884
DBFB1CFCE6CCAE6A13E22BC9 /* Pods_tvOS_Example.framework */,
8985
);
@@ -552,6 +548,7 @@
552548
PRODUCT_NAME = LicensesViewControllerExample;
553549
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
554550
SWIFT_VERSION = 4.0;
551+
TARGETED_DEVICE_FAMILY = "1,2";
555552
};
556553
name = Debug;
557554
};
@@ -569,6 +566,7 @@
569566
PRODUCT_NAME = LicensesViewControllerExample;
570567
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
571568
SWIFT_VERSION = 4.0;
569+
TARGETED_DEVICE_FAMILY = "1,2";
572570
};
573571
name = Release;
574572
};

Example/LicensesViewControllerExample/Base.lproj/iOS.storyboard

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13528" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ubA-JZ-Kxm">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ubA-JZ-Kxm">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13526"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
1111
<scenes>
@@ -40,6 +40,26 @@
4040
<segue destination="NtG-QR-8eQ" kind="show" identifier="AknowledgementSegue" id="MuW-Fd-sLf"/>
4141
</connections>
4242
</tableViewCell>
43+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" textLabel="Okz-Vh-BLk" style="IBUITableViewCellStyleDefault" id="7V1-0D-Zfa">
44+
<rect key="frame" x="0.0" y="99.5" width="375" height="44"/>
45+
<autoresizingMask key="autoresizingMask"/>
46+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7V1-0D-Zfa" id="O5p-JK-Js0">
47+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
48+
<autoresizingMask key="autoresizingMask"/>
49+
<subviews>
50+
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Aknowledgements Modal" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Okz-Vh-BLk">
51+
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
52+
<autoresizingMask key="autoresizingMask"/>
53+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
54+
<nil key="textColor"/>
55+
<nil key="highlightedColor"/>
56+
</label>
57+
</subviews>
58+
</tableViewCellContentView>
59+
<connections>
60+
<segue destination="5AH-X1-2AM" kind="presentation" identifier="AknowledgementSegueModal" modalPresentationStyle="formSheet" id="C5Y-qy-c2p"/>
61+
</connections>
62+
</tableViewCell>
4363
</cells>
4464
</tableViewSection>
4565
</sections>
@@ -70,7 +90,7 @@
7090
</viewController>
7191
<placeholder placeholderIdentifier="IBFirstResponder" id="qLC-iG-3Mq" userLabel="First Responder" sceneMemberID="firstResponder"/>
7292
</objects>
73-
<point key="canvasLocation" x="1475" y="416"/>
93+
<point key="canvasLocation" x="1828" y="-67"/>
7494
</scene>
7595
<!--Navigation Controller-->
7696
<scene sceneID="mdF-Oz-9j9">
@@ -93,6 +113,41 @@
93113
</objects>
94114
<point key="canvasLocation" x="-60" y="416"/>
95115
</scene>
116+
<!--Navigation Controller-->
117+
<scene sceneID="LDt-JN-zPp">
118+
<objects>
119+
<navigationController id="5AH-X1-2AM" sceneMemberID="viewController">
120+
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="dXI-kS-B2j">
121+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
122+
<autoresizingMask key="autoresizingMask"/>
123+
</navigationBar>
124+
<connections>
125+
<segue destination="HSu-PG-8hU" kind="relationship" relationship="rootViewController" id="J0T-ku-hSs"/>
126+
</connections>
127+
</navigationController>
128+
<placeholder placeholderIdentifier="IBFirstResponder" id="VaL-kU-iB9" userLabel="First Responder" sceneMemberID="firstResponder"/>
129+
</objects>
130+
<point key="canvasLocation" x="1615" y="724"/>
131+
</scene>
132+
<!--Licenses View Controller-->
133+
<scene sceneID="qN7-Bh-8L0">
134+
<objects>
135+
<viewController id="HSu-PG-8hU" customClass="LicensesViewController" customModule="LicensesViewController" sceneMemberID="viewController">
136+
<layoutGuides>
137+
<viewControllerLayoutGuide type="top" id="wuB-c9-0vk"/>
138+
<viewControllerLayoutGuide type="bottom" id="nTB-dt-1k0"/>
139+
</layoutGuides>
140+
<view key="view" contentMode="scaleToFill" id="gyN-Of-Yg4">
141+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
142+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
143+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
144+
</view>
145+
<navigationItem key="navigationItem" id="EDf-cR-dOZ"/>
146+
</viewController>
147+
<placeholder placeholderIdentifier="IBFirstResponder" id="r29-a1-uW3" userLabel="First Responder" sceneMemberID="firstResponder"/>
148+
</objects>
149+
<point key="canvasLocation" x="2335" y="724"/>
150+
</scene>
96151
</scenes>
97152
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
98153
</document>

Example/LicensesViewControllerExample/ViewController.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@ class ExampleTableViewController: UITableViewController {
1515
if let destinationVC = segue.destination as? LicensesViewController {
1616
destinationVC.loadPlist(Bundle.main, resourceName: "Credits")
1717
}
18+
} else if segue.identifier == "AknowledgementSegueModal" {
19+
if let destinationVC = (segue.destination as? UINavigationController)?.topViewController as? LicensesViewController {
20+
destinationVC.loadPlist(Bundle.main, resourceName: "Credits")
21+
22+
// add cancel button
23+
destinationVC.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancel))
24+
25+
}
1826
}
1927
}
28+
29+
@objc func cancel() {
30+
self.presentedViewController?.dismiss(animated: true)
31+
}
2032
}
2133

2234
class ExampleViewController: UIViewController {

LicensesViewController/LicensesViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ open class LicensesViewController : UIViewController {
3232
tableView.register(LicenseCell.classForCoder(), forCellReuseIdentifier: reuseIdentifier)
3333
tableView.rowHeight = UITableViewAutomaticDimension
3434
tableView.estimatedRowHeight = 68.0
35-
tableView.frame = view.bounds
35+
tableView.translatesAutoresizingMaskIntoConstraints = false
3636

3737
view.addSubview(tableView)
3838
}

0 commit comments

Comments
 (0)