Skip to content

Commit 2d264ea

Browse files
committed
Avoid MainActor.assumeIsolated
1 parent 21cf3f0 commit 2d264ea

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

Sources/PulseUI/Features/Console/ConsoleDataSource.swift

+5-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ protocol ConsoleDataSourceDelegate: AnyObject {
1717
func dataSource(_ dataSource: ConsoleDataSource, didUpdateWith diff: CollectionDifference<NSManagedObjectID>?)
1818
}
1919

20-
@MainActor
2120
final class ConsoleDataSource: NSObject, NSFetchedResultsControllerDelegate {
2221
weak var delegate: ConsoleDataSourceDelegate?
2322

@@ -103,7 +102,7 @@ final class ConsoleDataSource: NSObject, NSFetchedResultsControllerDelegate {
103102
controller.delegate = controllerDelegate
104103
}
105104

106-
func bind(_ filters: ConsoleFiltersViewModel) {
105+
@MainActor func bind(_ filters: ConsoleFiltersViewModel) {
107106
cancellables = []
108107
filters.$options.sink { [weak self] in
109108
self?.predicate = $0
@@ -135,16 +134,12 @@ final class ConsoleDataSource: NSObject, NSFetchedResultsControllerDelegate {
135134

136135
// MARK: NSFetchedResultsControllerDelegate
137136

138-
nonisolated func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
139-
MainActor.assumeIsolated {
140-
delegate?.dataSource(self, didUpdateWith: nil)
141-
}
137+
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
138+
delegate?.dataSource(self, didUpdateWith: nil)
142139
}
143140

144-
nonisolated func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith diff: CollectionDifference<NSManagedObjectID>) {
145-
MainActor.assumeIsolated {
146-
delegate?.dataSource(self, didUpdateWith: diff)
147-
}
141+
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith diff: CollectionDifference<NSManagedObjectID>) {
142+
delegate?.dataSource(self, didUpdateWith: diff)
148143
}
149144

150145
// MARK: Predicate

0 commit comments

Comments
 (0)