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
+31
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,35 @@ Swift Next
69
69
Swift 5.3
70
70
---------
71
71
72
+
*[SE-0279][] & [SE-0286][]:
73
+
74
+
Trailing closure syntax has been extended to allow additional labeled closures to follow the initial unlabeled closure:
75
+
76
+
```swift
77
+
// Single trailing closure argument
78
+
UIView.animate(withDuration: 0.3) {
79
+
self.view.alpha=0
80
+
}
81
+
// Multiple trailing closure arguments
82
+
UIView.animate(withDuration: 0.3) {
83
+
self.view.alpha=0
84
+
} completion: { _in
85
+
self.view.removeFromSuperview()
86
+
}
87
+
```
88
+
89
+
Additionally, trailing closure arguments now match the appropriate parameter according to a forward-scan rule (as opposed to the previous backward-scan rule):
In the above example, the trailing closure argument matches parameter `first`, whereas pre-Swift-5.3 it would have matched `second`. In order to ease the transition to this new rule, cases in which the forward-scan and backward-scan match a single trailing closure to different parameters, the backward-scan result is preferred and a warning is emitted. This is expected to be upgraded to an error in the next major version of Swift.
100
+
72
101
*[SR-7083][]:
73
102
74
103
Property observers such as `willSet` and `didSet` are now supported on `lazy` properties:
0 commit comments