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
-`task.progress()`'s `progressClosure` type changed from `Progress -> Void` to `(oldProgress: Progress?, newProgress: Progress) -> Void`
19
-
-`task.then(fulfilledClosure)` is renamed to `task.success()`
20
-
-`task.catch(catchClosure)` is renamed to `task.failure()`
21
-
-`task.then()` is now used for completed (either fulfilled or rejected) case only, and **no longer used for fulfilled-only handling** (this will improve Swift type-inference)
22
-
23
8
24
9
## How to install
25
10
@@ -47,13 +32,13 @@ let task = Task<Float, String, NSError> { progress, fulfill, reject, configure i
47
32
48
33
// pause/resume/cancel configuration (optional)
49
34
configure.pause= { [weak player] in
50
-
iflet p =player { p.pause() }
35
+
player?.pause()
51
36
}
52
37
configure.resume= { [weak player] in
53
-
iflet p =player { p.resume() }
38
+
player?.resume()
54
39
}
55
40
configure.cancel= { [weak player] in
56
-
iflet p =player { p.cancel() }
41
+
player?.cancel()
57
42
}
58
43
59
44
}
@@ -171,13 +156,13 @@ To add `pause`/`resume`/`cancel` functionality to your `task`, use `configure` t
171
156
```swift
172
157
// NOTE: use weak to let task NOT CAPTURE player via configure
0 commit comments