We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2558165 + a78d0f0 commit 62ee3a1Copy full SHA for 62ee3a1
CHANGELOG.md
@@ -47,6 +47,25 @@ Swift 5.0
47
Swift 4.1
48
---------
49
50
+* [SE-0075][]
51
+
52
+ Compile-time testing for the existence and importability of modules is now
53
+ implemented as a build configuration test. The `canImport` test allows
54
+ the development of features that require a possibly-failing import
55
+ declaration across multiple platforms.
56
57
+ ```swift
58
+ #if canImport(UIKit)
59
+ import UIKit
60
+ class MyView : UIView {}
61
+ #elseif canImport(AppKit)
62
+ import AppKit
63
+ class MyView : NSView {}
64
+ #else
65
+ class MyView : CustomView {}
66
+ #endif
67
+ ```
68
69
* [SE-0189][]
70
71
If an initializer is declared in a different module from a struct, it must
0 commit comments