Skip to content

Commit 9663a83

Browse files
committed
[PlaygroundSupport] Migrated the PlaygroundSupport framework and its tests to Swift 4.2.
This is for <rdar://problem/45676453>.
1 parent 49c3642 commit 9663a83

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,24 @@
832832
CreatedOnToolsVersion = 8.0;
833833
ProvisioningStyle = Automatic;
834834
};
835+
A8318F8F1CF603630015809A = {
836+
LastSwiftMigration = 1010;
837+
};
838+
A8318FA21CF6036E0015809A = {
839+
LastSwiftMigration = 1010;
840+
};
841+
A8318FB41CF603790015809A = {
842+
LastSwiftMigration = 1010;
843+
};
844+
A8318FF51CF607C00015809A = {
845+
LastSwiftMigration = 1010;
846+
};
847+
A83190031CF607C50015809A = {
848+
LastSwiftMigration = 1010;
849+
};
850+
A83190111CF607C70015809A = {
851+
LastSwiftMigration = 1010;
852+
};
835853
A8FBD6A21C74FEE6005B5982 = {
836854
CreatedOnToolsVersion = 7.3;
837855
};
@@ -1517,6 +1535,7 @@
15171535
SDKROOT = macosx;
15181536
STRIP_SWIFT_SYMBOLS = NO;
15191537
SWIFT_INSTALL_OBJC_HEADER = NO;
1538+
SWIFT_VERSION = 4.2;
15201539
};
15211540
name = Debug;
15221541
};
@@ -1538,6 +1557,7 @@
15381557
SDKROOT = macosx;
15391558
STRIP_SWIFT_SYMBOLS = NO;
15401559
SWIFT_INSTALL_OBJC_HEADER = NO;
1560+
SWIFT_VERSION = 4.2;
15411561
};
15421562
name = Release;
15431563
};
@@ -1584,6 +1604,7 @@
15841604
STRIP_SWIFT_SYMBOLS = NO;
15851605
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
15861606
SWIFT_INSTALL_OBJC_HEADER = NO;
1607+
SWIFT_VERSION = 4.2;
15871608
VALID_ARCHS = x86_64;
15881609
WRAPPER_EXTENSION = framework;
15891610
};
@@ -1626,6 +1647,7 @@
16261647
STRIP_SWIFT_SYMBOLS = NO;
16271648
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
16281649
SWIFT_INSTALL_OBJC_HEADER = NO;
1650+
SWIFT_VERSION = 4.2;
16291651
VALIDATE_PRODUCT = YES;
16301652
VALID_ARCHS = x86_64;
16311653
WRAPPER_EXTENSION = framework;
@@ -1675,6 +1697,7 @@
16751697
STRIP_SWIFT_SYMBOLS = NO;
16761698
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
16771699
SWIFT_INSTALL_OBJC_HEADER = NO;
1700+
SWIFT_VERSION = 4.2;
16781701
VALID_ARCHS = x86_64;
16791702
WRAPPER_EXTENSION = framework;
16801703
};
@@ -1717,6 +1740,7 @@
17171740
STRIP_SWIFT_SYMBOLS = NO;
17181741
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
17191742
SWIFT_INSTALL_OBJC_HEADER = NO;
1743+
SWIFT_VERSION = 4.2;
17201744
VALIDATE_PRODUCT = YES;
17211745
VALID_ARCHS = x86_64;
17221746
WRAPPER_EXTENSION = framework;
@@ -1777,6 +1801,7 @@
17771801
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-OSX";
17781802
PRODUCT_NAME = "$(TARGET_NAME)";
17791803
SDKROOT = macosx;
1804+
SWIFT_VERSION = 4.2;
17801805
};
17811806
name = Debug;
17821807
};
@@ -1815,6 +1840,7 @@
18151840
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-OSX";
18161841
PRODUCT_NAME = "$(TARGET_NAME)";
18171842
SDKROOT = macosx;
1843+
SWIFT_VERSION = 4.2;
18181844
};
18191845
name = Release;
18201846
};
@@ -1856,6 +1882,7 @@
18561882
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-iOS";
18571883
PRODUCT_NAME = "$(TARGET_NAME)";
18581884
SDKROOT = iphoneos;
1885+
SWIFT_VERSION = 4.2;
18591886
};
18601887
name = Debug;
18611888
};
@@ -1892,6 +1919,7 @@
18921919
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-iOS";
18931920
PRODUCT_NAME = "$(TARGET_NAME)";
18941921
SDKROOT = iphoneos;
1922+
SWIFT_VERSION = 4.2;
18951923
VALIDATE_PRODUCT = YES;
18961924
};
18971925
name = Release;
@@ -1933,6 +1961,7 @@
19331961
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-tvOS";
19341962
PRODUCT_NAME = "$(TARGET_NAME)";
19351963
SDKROOT = appletvos;
1964+
SWIFT_VERSION = 4.2;
19361965
};
19371966
name = Debug;
19381967
};
@@ -1968,6 +1997,7 @@
19681997
PRODUCT_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode.PlaygroundSupportTests-tvOS";
19691998
PRODUCT_NAME = "$(TARGET_NAME)";
19701999
SDKROOT = appletvos;
2000+
SWIFT_VERSION = 4.2;
19712001
VALIDATE_PRODUCT = YES;
19722002
};
19732003
name = Release;

PlaygroundSupport/PlaygroundSupportTests/LiveViewTests.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ fileprivate typealias ViewType = UIView
2525
fileprivate typealias ViewControllerType = UIViewController
2626
#endif
2727

28+
// This is intentionally redefined here in the tests, as this string cannot change as it has clients which refer to it by the string value rather than by symbol.
29+
fileprivate let playgroundPageLiveViewDidChangeNotification = Notification.Name(rawValue: "PlaygroundPageLiveViewDidChangeNotification")
30+
2831
class LiveViewTests: XCTestCase {
2932

3033
override func setUp() {
@@ -41,7 +44,7 @@ class LiveViewTests: XCTestCase {
4144
let view = ViewType()
4245

4346
// Test setting to a view
44-
expectation(forNotification: "PlaygroundPageLiveViewDidChangeNotification", object: PlaygroundPage.current) { (notification) in
47+
expectation(forNotification: playgroundPageLiveViewDidChangeNotification, object: PlaygroundPage.current) { (notification) in
4548
guard let userInfoView = notification.userInfo?["PlaygroundPageLiveView"] as? ViewType else { return false }
4649
guard notification.userInfo?["PlaygroundPageLiveViewController"] == nil else { return false }
4750
XCTAssertEqual(userInfoView, view)
@@ -51,7 +54,7 @@ class LiveViewTests: XCTestCase {
5154
waitForExpectations(timeout: 0.1, handler: nil)
5255

5356
// Test setting back to nil
54-
expectation(forNotification: "PlaygroundPageLiveViewDidChangeNotification", object: PlaygroundPage.current) { (notification) in
57+
expectation(forNotification: playgroundPageLiveViewDidChangeNotification, object: PlaygroundPage.current) { (notification) in
5558
guard notification.userInfo?["PlaygroundPageLiveView"] == nil else { return false }
5659
guard notification.userInfo?["PlaygroundPageLiveViewController"] == nil else { return false }
5760
return true
@@ -64,7 +67,7 @@ class LiveViewTests: XCTestCase {
6467
let viewController = ViewControllerType()
6568

6669
// Test setting to a view controller
67-
expectation(forNotification: "PlaygroundPageLiveViewDidChangeNotification", object: PlaygroundPage.current) { (notification) in
70+
expectation(forNotification: playgroundPageLiveViewDidChangeNotification, object: PlaygroundPage.current) { (notification) in
6871
guard let userInfoViewController = notification.userInfo?["PlaygroundPageLiveViewController"] as? ViewControllerType else { return false }
6972
guard notification.userInfo?["PlaygroundPageLiveView"] == nil else { return false }
7073
XCTAssertEqual(userInfoViewController, viewController)
@@ -74,7 +77,7 @@ class LiveViewTests: XCTestCase {
7477
waitForExpectations(timeout: 0.1, handler: nil)
7578

7679
// Test setting back to nil
77-
expectation(forNotification: "PlaygroundPageLiveViewDidChangeNotification", object: PlaygroundPage.current) { (notification) in
80+
expectation(forNotification: playgroundPageLiveViewDidChangeNotification, object: PlaygroundPage.current) { (notification) in
7881
guard notification.userInfo?["PlaygroundPageLiveView"] == nil else { return false }
7982
guard notification.userInfo?["PlaygroundPageLiveViewController"] == nil else { return false }
8083
return true

0 commit comments

Comments
 (0)