Skip to content

Commit ba96e71

Browse files
authored
Merge pull request #473 from iwill/master
Fully supports iOS 11 safeAreaLayoutGuide, and fix #470
2 parents 9e9017c + 53a095b commit ba96e71

22 files changed

+269
-103
lines changed

Examples/[email protected]

-18.2 KB
Binary file not shown.

Examples/Masonry iOS Examples.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/* Begin PBXBuildFile section */
1010
00FC4A321B7359D700DCA999 /* MASExampleDistributeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00FC4A311B7359D700DCA999 /* MASExampleDistributeView.m */; };
11-
114413091924B6EE008E702E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 114413081924B6EE008E702E /* [email protected] */; };
1211
27A27D461A6CF0C400D34F52 /* MASExampleAspectFitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A27D451A6CF0C400D34F52 /* MASExampleAspectFitView.m */; };
1312
3C02224919D0C4EC00507321 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C02224819D0C4EC00507321 /* Images.xcassets */; };
1413
3DB1CAD5184538E200E91FC5 /* MASExampleArrayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB1CAD4184538E200E91FC5 /* MASExampleArrayView.m */; };
@@ -33,12 +32,13 @@
3332
DD9B4D35183CC980002BF408 /* MASExampleScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD9B4D34183CC980002BF408 /* MASExampleScrollView.m */; };
3433
DDDF60CC181915E300BF7B8B /* MASExampleLabelView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDDF60CB181915E300BF7B8B /* MASExampleLabelView.m */; };
3534
DDF3875C179D648D00178773 /* MASExampleAnimatedView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDF3875B179D648D00178773 /* MASExampleAnimatedView.m */; };
35+
DFBACE591F7B76E40047F15A /* MASExampleSafeAreaLayoutGuideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBACE581F7B76E40047F15A /* MASExampleSafeAreaLayoutGuideViewController.m */; };
36+
DFBACE5D1F7B86860047F15A /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DFBACE5C1F7B86860047F15A /* Launch Screen.storyboard */; };
3637
/* End PBXBuildFile section */
3738

3839
/* Begin PBXFileReference section */
3940
00FC4A301B7359D700DCA999 /* MASExampleDistributeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleDistributeView.h; sourceTree = "<group>"; };
4041
00FC4A311B7359D700DCA999 /* MASExampleDistributeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleDistributeView.m; sourceTree = "<group>"; };
41-
114413081924B6EE008E702E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
4242
27A27D441A6CF0C400D34F52 /* MASExampleAspectFitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleAspectFitView.h; sourceTree = "<group>"; };
4343
27A27D451A6CF0C400D34F52 /* MASExampleAspectFitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleAspectFitView.m; sourceTree = "<group>"; };
4444
321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Masonry iOS Examples.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Masonry iOS Examples/Pods-Masonry iOS Examples.release.xcconfig"; sourceTree = "<group>"; };
@@ -85,6 +85,9 @@
8585
DDDF60CB181915E300BF7B8B /* MASExampleLabelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleLabelView.m; sourceTree = "<group>"; };
8686
DDF3875A179D648D00178773 /* MASExampleAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleAnimatedView.h; sourceTree = "<group>"; };
8787
DDF3875B179D648D00178773 /* MASExampleAnimatedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleAnimatedView.m; sourceTree = "<group>"; };
88+
DFBACE571F7B76E30047F15A /* MASExampleSafeAreaLayoutGuideViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MASExampleSafeAreaLayoutGuideViewController.h; sourceTree = "<group>"; };
89+
DFBACE581F7B76E40047F15A /* MASExampleSafeAreaLayoutGuideViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MASExampleSafeAreaLayoutGuideViewController.m; sourceTree = "<group>"; };
90+
DFBACE5C1F7B86860047F15A /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
8891
/* End PBXFileReference section */
8992

9093
/* Begin PBXFrameworksBuildPhase section */
@@ -105,7 +108,6 @@
105108
DD52F21E179CAD57005CD195 = {
106109
isa = PBXGroup;
107110
children = (
108-
114413081924B6EE008E702E /* [email protected] */,
109111
DD52F230179CAD57005CD195 /* Masonry iOS Examples */,
110112
DD52F229179CAD57005CD195 /* Frameworks */,
111113
DD52F228179CAD57005CD195 /* Products */,
@@ -141,6 +143,7 @@
141143
DD52F256179CADC4005CD195 /* Views */,
142144
3C02224819D0C4EC00507321 /* Images.xcassets */,
143145
DD52F231179CAD57005CD195 /* Supporting Files */,
146+
DFBACE5C1F7B86860047F15A /* Launch Screen.storyboard */,
144147
);
145148
path = "Masonry iOS Examples";
146149
sourceTree = "<group>";
@@ -200,6 +203,8 @@
200203
DD52F250179CADC0005CD195 /* MASExampleViewController.m */,
201204
DD653E481843E61500D1EC5A /* MASExampleLayoutGuideViewController.h */,
202205
DD653E491843E61500D1EC5A /* MASExampleLayoutGuideViewController.m */,
206+
DFBACE571F7B76E30047F15A /* MASExampleSafeAreaLayoutGuideViewController.h */,
207+
DFBACE581F7B76E40047F15A /* MASExampleSafeAreaLayoutGuideViewController.m */,
203208
);
204209
name = Controllers;
205210
sourceTree = "<group>";
@@ -268,9 +273,9 @@
268273
isa = PBXResourcesBuildPhase;
269274
buildActionMask = 2147483647;
270275
files = (
276+
DFBACE5D1F7B86860047F15A /* Launch Screen.storyboard in Resources */,
271277
3C02224919D0C4EC00507321 /* Images.xcassets in Resources */,
272278
DD52F235179CAD57005CD195 /* InfoPlist.strings in Resources */,
273-
114413091924B6EE008E702E /* [email protected] in Resources */,
274279
);
275280
runOnlyForDeploymentPostprocessing = 0;
276281
};
@@ -344,6 +349,7 @@
344349
27A27D461A6CF0C400D34F52 /* MASExampleAspectFitView.m in Sources */,
345350
DD52F252179CADC0005CD195 /* MASExampleConstantsView.m in Sources */,
346351
DD52F253179CADC0005CD195 /* MASExampleListViewController.m in Sources */,
352+
DFBACE591F7B76E40047F15A /* MASExampleSafeAreaLayoutGuideViewController.m in Sources */,
347353
DD52F254179CADC0005CD195 /* MASExampleSidesView.m in Sources */,
348354
DD32C3FD18E8BFF6001F6AD2 /* MASExampleAttributeChainingView.m in Sources */,
349355
DD52F255179CADC0005CD195 /* MASExampleViewController.m in Sources */,
@@ -409,7 +415,6 @@
409415
GCC_WARN_UNINITIALIZED_AUTOS = YES;
410416
GCC_WARN_UNUSED_FUNCTION = YES;
411417
GCC_WARN_UNUSED_VARIABLE = YES;
412-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
413418
ONLY_ACTIVE_ARCH = YES;
414419
SDKROOT = iphoneos;
415420
TARGETED_DEVICE_FAMILY = "1,2";
@@ -449,7 +454,6 @@
449454
GCC_WARN_UNINITIALIZED_AUTOS = YES;
450455
GCC_WARN_UNUSED_FUNCTION = YES;
451456
GCC_WARN_UNUSED_VARIABLE = YES;
452-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
453457
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
454458
SDKROOT = iphoneos;
455459
TARGETED_DEVICE_FAMILY = "1,2";
@@ -461,11 +465,9 @@
461465
isa = XCBuildConfiguration;
462466
baseConfigurationReference = 50B25D0621957AEB87C3FCC2 /* Pods-Masonry iOS Examples.debug.xcconfig */;
463467
buildSettings = {
464-
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
465468
GCC_PRECOMPILE_PREFIX_HEADER = YES;
466469
GCC_PREFIX_HEADER = "Masonry iOS Examples/Masonry iOS Examples-Prefix.pch";
467470
INFOPLIST_FILE = "Masonry iOS Examples/Masonry iOS Examples-Info.plist";
468-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
469471
PRODUCT_BUNDLE_IDENTIFIER = "com.cloudling.${PRODUCT_NAME:rfc1034identifier}";
470472
PRODUCT_NAME = "Masonry iOS Examples";
471473
WRAPPER_EXTENSION = app;
@@ -476,11 +478,9 @@
476478
isa = XCBuildConfiguration;
477479
baseConfigurationReference = 321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */;
478480
buildSettings = {
479-
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
480481
GCC_PRECOMPILE_PREFIX_HEADER = YES;
481482
GCC_PREFIX_HEADER = "Masonry iOS Examples/Masonry iOS Examples-Prefix.pch";
482483
INFOPLIST_FILE = "Masonry iOS Examples/Masonry iOS Examples-Info.plist";
483-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
484484
PRODUCT_BUNDLE_IDENTIFIER = "com.cloudling.${PRODUCT_NAME:rfc1034identifier}";
485485
PRODUCT_NAME = "Masonry iOS Examples";
486486
WRAPPER_EXTENSION = app;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

Examples/Masonry iOS Examples/Images.xcassets/LaunchImage.launchimage/Contents.json

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
8+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10+
</dependencies>
11+
<scenes>
12+
<!--View Controller-->
13+
<scene sceneID="EHf-IW-A2E">
14+
<objects>
15+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
16+
<layoutGuides>
17+
<viewControllerLayoutGuide type="top" id="cbD-vd-OFn"/>
18+
<viewControllerLayoutGuide type="bottom" id="TBi-GG-GBk"/>
19+
</layoutGuides>
20+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23+
<subviews>
24+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
25+
<rect key="frame" x="47.5" y="592.5" width="281" height="41"/>
26+
<string key="text">Copyright © 2017 Jonas Budelmann.
27+
All rights reserved.</string>
28+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
29+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
30+
<nil key="highlightedColor"/>
31+
</label>
32+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Masonry" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
33+
<rect key="frame" x="114.5" y="202" width="146" height="43"/>
34+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
35+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
36+
<nil key="highlightedColor"/>
37+
</label>
38+
</subviews>
39+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
40+
<constraints>
41+
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
42+
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
43+
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="34" id="Y44-ml-fuU"/>
44+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
45+
</constraints>
46+
</view>
47+
</viewController>
48+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
49+
</objects>
50+
<point key="canvasLocation" x="52" y="374.66266866566718"/>
51+
</scene>
52+
</scenes>
53+
</document>

Examples/Masonry iOS Examples/MASExampleListViewController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#import "MASExampleRemakeView.h"
1919
#import "MASExampleScrollView.h"
2020
#import "MASExampleLayoutGuideViewController.h"
21+
#import "MASExampleSafeAreaLayoutGuideViewController.h"
2122
#import "MASExampleArrayView.h"
2223
#import "MASExampleAttributeChainingView.h"
2324
#import "MASExampleAspectFitView.h"
@@ -77,6 +78,11 @@ - (id)init {
7778
self.exampleControllers = [self.exampleControllers arrayByAddingObject:[[MASExampleLayoutGuideViewController alloc] init]];
7879
}
7980

81+
if ([UIView instancesRespondToSelector:@selector(safeAreaLayoutGuide)])
82+
{
83+
self.exampleControllers = [self.exampleControllers arrayByAddingObject:[[MASExampleSafeAreaLayoutGuideViewController alloc] init]];
84+
}
85+
8086
return self;
8187
}
8288

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// MASExampleSafeAreaLayoutGuideViewController.h
3+
// Masonry iOS Examples
4+
//
5+
// Created by MingLQ on 2017-09-27.
6+
// Copyright © 2017 MingLQ. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface MASExampleSafeAreaLayoutGuideViewController : UIViewController
12+
13+
@end

0 commit comments

Comments
 (0)