Skip to content

Commit 4660247

Browse files
authored
Fix async crash when updating view model (#155)
Closes #152. Fixed possible crash in `async` version of `CollectionViewDriver.update(viewModel: animated:)` due to incorrect handling of the `continuation`.
1 parent aa6490a commit 4660247

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This release closes the [0.1.9 milestone](https://github.com/jessesquires/Reacti
1616
- Previous behavior: `"MyCellClassName"`
1717
- New behavior: `"MyModuleName.MyCellClassName"`
1818
- **Note:** This should be a transparent change and not impact any existing code. If you were previously working around this issue by providing a custom `reuseIdentifier`, you can now adopt the default implementation instead.
19+
- Fixed possible crash in `async` version of `CollectionViewDriver.update(viewModel: animated:)` due to incorrect handling of the `continuation`. ([@jessesquires](https://github.com/jessesquires), [#152](https://github.com/jessesquires/ReactiveCollectionsKit/issues/152), [#155](https://github.com/jessesquires/ReactiveCollectionsKit/pull/155))
1920
- Improve debug descriptions (i.e., `CustomDebugStringConvertible`) for various types. ([@nuomi1](https://github.com/nuomi1), [#139](https://github.com/jessesquires/ReactiveCollectionsKit/pull/139))
2021
- Implement (optional) debug logging for view model updates. You can now provide a logger for debugging purposes by setting `CollectionViewDriver.logger`. The library provides a default implementation via `RCKLogger.shared`. ([@nuomi1](https://github.com/nuomi1), [#141](https://github.com/jessesquires/ReactiveCollectionsKit/pull/141))
2122
- Upgrade to Xcode 26. ([@jessesquires](https://github.com/jessesquires), [#153](https://github.com/jessesquires/ReactiveCollectionsKit/pull/153))

Sources/CollectionViewDriver.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ public final class CollectionViewDriver: NSObject {
178178
/// You can customize this behavior via the ``options`` for the driver.
179179
public func update(viewModel new: CollectionViewModel, animated: Bool = true) async {
180180
await withCheckedContinuation { continuation in
181-
self.update(viewModel: new, animated: animated)
182-
continuation.resume()
181+
self.update(viewModel: new, animated: animated) { _ in
182+
continuation.resume()
183+
}
183184
}
184185
}
185186

0 commit comments

Comments
 (0)