Skip to content

Commit 62ee3a1

Browse files
authored
Merge pull request swiftlang#14911 from CodaFi/chicken-tax
2 parents 2558165 + a78d0f0 commit 62ee3a1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ Swift 5.0
4747
Swift 4.1
4848
---------
4949

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+
5069
* [SE-0189][]
5170

5271
If an initializer is declared in a different module from a struct, it must

0 commit comments

Comments
 (0)