Skip to content

Commit df408dc

Browse files
committed
Use consistent version of Swift across project
1 parent 0544e17 commit df408dc

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

PinLayout.xcodeproj/project.pbxproj

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,6 @@
10951095
SDKROOT = appletvos;
10961096
SKIP_INSTALL = YES;
10971097
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
1098-
SWIFT_VERSION = 4.0;
10991098
TARGETED_DEVICE_FAMILY = 3;
11001099
TVOS_DEPLOYMENT_TARGET = 9.0;
11011100
};
@@ -1119,7 +1118,6 @@
11191118
SDKROOT = appletvos;
11201119
SKIP_INSTALL = YES;
11211120
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
1122-
SWIFT_VERSION = 4.0;
11231121
TARGETED_DEVICE_FAMILY = 3;
11241122
TVOS_DEPLOYMENT_TARGET = 9.0;
11251123
};
@@ -1183,7 +1181,7 @@
11831181
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
11841182
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
11851183
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1186-
SWIFT_VERSION = 4.0;
1184+
SWIFT_VERSION = 5.0;
11871185
TARGETED_DEVICE_FAMILY = "1,2";
11881186
TVOS_DEPLOYMENT_TARGET = 9.0;
11891187
VERSIONING_SYSTEM = "apple-generic";
@@ -1241,7 +1239,7 @@
12411239
SDKROOT = iphoneos;
12421240
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
12431241
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1244-
SWIFT_VERSION = 4.0;
1242+
SWIFT_VERSION = 5.0;
12451243
TARGETED_DEVICE_FAMILY = "1,2";
12461244
TVOS_DEPLOYMENT_TARGET = 9.0;
12471245
VALIDATE_PRODUCT = YES;
@@ -1267,7 +1265,6 @@
12671265
PRODUCT_NAME = PinLayout;
12681266
SKIP_INSTALL = YES;
12691267
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1270-
SWIFT_VERSION = 5.0;
12711268
};
12721269
name = Debug;
12731270
};
@@ -1287,7 +1284,6 @@
12871284
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.PinLayout-iOS";
12881285
PRODUCT_NAME = PinLayout;
12891286
SKIP_INSTALL = YES;
1290-
SWIFT_VERSION = 5.0;
12911287
};
12921288
name = Release;
12931289
};
@@ -1302,7 +1298,6 @@
13021298
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
13031299
PRODUCT_BUNDLE_IDENTIFIER = com.mirego.PinLayoutTests;
13041300
PRODUCT_NAME = "$(TARGET_NAME)";
1305-
SWIFT_VERSION = 5.0;
13061301
};
13071302
name = Debug;
13081303
};
@@ -1317,7 +1312,6 @@
13171312
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
13181313
PRODUCT_BUNDLE_IDENTIFIER = com.mirego.PinLayoutTests;
13191314
PRODUCT_NAME = "$(TARGET_NAME)";
1320-
SWIFT_VERSION = 5.0;
13211315
};
13221316
name = Release;
13231317
};
@@ -1343,7 +1337,6 @@
13431337
PRODUCT_NAME = "$(TARGET_NAME)";
13441338
SDKROOT = macosx;
13451339
SUPPORTED_PLATFORMS = macosx;
1346-
SWIFT_VERSION = 4.0;
13471340
};
13481341
name = Debug;
13491342
};
@@ -1369,7 +1362,6 @@
13691362
PRODUCT_NAME = "$(TARGET_NAME)";
13701363
SDKROOT = macosx;
13711364
SUPPORTED_PLATFORMS = macosx;
1372-
SWIFT_VERSION = 4.0;
13731365
};
13741366
name = Release;
13751367
};
@@ -1402,7 +1394,6 @@
14021394
SDKROOT = macosx;
14031395
SKIP_INSTALL = YES;
14041396
SUPPORTED_PLATFORMS = macosx;
1405-
SWIFT_VERSION = 4.0;
14061397
};
14071398
name = Debug;
14081399
};
@@ -1435,7 +1426,6 @@
14351426
SDKROOT = macosx;
14361427
SKIP_INSTALL = YES;
14371428
SUPPORTED_PLATFORMS = macosx;
1438-
SWIFT_VERSION = 4.0;
14391429
};
14401430
name = Release;
14411431
};
@@ -1458,7 +1448,6 @@
14581448
PRODUCT_NAME = "$(TARGET_NAME)";
14591449
SDKROOT = appletvos;
14601450
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
1461-
SWIFT_VERSION = 4.0;
14621451
TARGETED_DEVICE_FAMILY = 3;
14631452
TVOS_DEPLOYMENT_TARGET = 11.3;
14641453
};
@@ -1483,7 +1472,6 @@
14831472
PRODUCT_NAME = "$(TARGET_NAME)";
14841473
SDKROOT = appletvos;
14851474
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
1486-
SWIFT_VERSION = 4.0;
14871475
TARGETED_DEVICE_FAMILY = 3;
14881476
TVOS_DEPLOYMENT_TARGET = 11.3;
14891477
};

Sources/Extensions/UIView+PinLayout.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,8 @@ extension UIView: AutoSizeCalculable {
122122
}
123123

124124
public func setAutoSizingRect(_ rect: CGRect, margins: PEdgeInsets) {
125-
#if os(tvOS)
126-
let rectWithMargins = UIEdgeInsetsInsetRect(rect, margins)
127-
#else
128-
let rectWithMargins = rect.inset(by: margins)
129-
#endif
130-
131125
self.autoSizingRect = Coordinates<View>.adjustRectToDisplayScale(rect)
132-
self.autoSizingRectWithMargins = Coordinates<View>.adjustRectToDisplayScale(rectWithMargins)
126+
self.autoSizingRectWithMargins = Coordinates<View>.adjustRectToDisplayScale(rect.inset(by: margins))
133127
}
134128

135129
public func autoSizeThatFits(_ size: CGSize, layoutClosure: () -> Void) -> CGSize {

0 commit comments

Comments
 (0)