You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,32 @@ CHANGELOG
21
21
Swift 4.0
22
22
---------
23
23
24
+
*[SE-0160][]
25
+
26
+
In Swift 4 mode, a declaration is inferred to be `@objc` where it is required for semantic consistency of the programming model. Specifically, it is inferred when:
27
+
28
+
* The declaration is an override of an `@objc` declaration
29
+
* The declaration satisfies a requirement in an `@objc` protocol
30
+
* The declaration has one of the following attributes: `@IBAction`, `@IBOutlet`, `@IBInspectable`, `@GKInspectable`, or `@NSManaged`
31
+
32
+
Additionally, in Swift 4 mode, `dynamic` declarations that don't
33
+
have `@objc` inferred based on the rules above will need to be
34
+
explicitly marked `@objc`.
35
+
36
+
Swift 3 compatibility mode retains the more-permissive Swift 3
37
+
rules for inference of `@objc` within subclasses of
38
+
`NSObject`. However, the compiler will emit warnings about places
39
+
where the Objective-C entry points for these inference cases are
40
+
used, e.g., in a `#selector` or `#keyPath` expression, via
41
+
messaging through `AnyObject`, or direct uses in Objective-C code
42
+
within a mixed project. The warnings can be silenced by adding an
43
+
explicit `@objc`. Uses of these entrypoints that are not
44
+
statically visible to the compiler can be diagnosed at runtime by
45
+
setting the environment variable
46
+
`SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT` to a value between 1 and 3
47
+
and testing the application. See the [migration discussion in
0 commit comments