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
_**Note:** This is in reverse chronological order, so newer entries are added to the top._
28
5
29
6
Swift 5.5
30
7
---------
31
8
32
9
*[SE-0306][]:
33
10
34
-
Swift 5.5 includes support for actors, a new kind of type that isolates its instance data to protect it from concurrent access. Accesses to an actor's instance declarations from outside the must be asynchronous:
11
+
Swift 5.5 includes support for actors, a new kind of type that isolates its instance data to protect it from concurrent access. Accesses to an actor's instance declarations from outside the must be asynchronous:
35
12
36
-
```swift
13
+
```swift
37
14
actorCounter {
38
15
var value =0
39
16
@@ -46,7 +23,7 @@ Swift 5.5
46
23
print(await counter.value) // interaction must be async
47
24
await counter.increment() // interaction must be async
48
25
}
49
-
```
26
+
```
50
27
51
28
* The determination of whether a call to a `rethrows` function can throw now considers default arguments of `Optional` type.
52
29
@@ -192,11 +169,11 @@ Swift 5.5
192
169
193
170
The "for" loop can be used to traverse asynchronous sequences in asynchronous code:
194
171
195
-
```swift
172
+
```swift
196
173
fortryawait line in myFile.lines() {
197
174
// Do something with each line
198
175
}
199
-
```
176
+
```
200
177
201
178
Asynchronous for loops use asynchronous sequences, defined by the protocol
202
179
`AsyncSequence` and its corresponding `AsyncIterator`.
0 commit comments