mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-07-19 03:01:13 +02:00
Initial prototype for Swift 6 mode
This commit is contained in:
@@ -185,57 +185,90 @@ extension DiffableDataSource {
|
||||
|
||||
public var shouldSuspendBatchUpdates: Bool {
|
||||
|
||||
return self.base?.window == nil
|
||||
return MainActor.assumeIsolated {
|
||||
|
||||
return self.base?.window == nil
|
||||
}
|
||||
}
|
||||
|
||||
public func deleteSections(at indices: IndexSet, animated: Bool) {
|
||||
|
||||
self.base?.deleteSections(indices)
|
||||
|
||||
MainActor.assumeIsolated {
|
||||
|
||||
self.base?.deleteSections(indices)
|
||||
}
|
||||
}
|
||||
|
||||
public func insertSections(at indices: IndexSet, animated: Bool) {
|
||||
|
||||
self.base?.insertSections(indices)
|
||||
|
||||
MainActor.assumeIsolated {
|
||||
|
||||
self.base?.insertSections(indices)
|
||||
}
|
||||
}
|
||||
|
||||
public func reloadSections(at indices: IndexSet, animated: Bool) {
|
||||
|
||||
self.base?.reloadSections(indices)
|
||||
|
||||
MainActor.assumeIsolated {
|
||||
|
||||
self.base?.reloadSections(indices)
|
||||
}
|
||||
}
|
||||
|
||||
public func moveSection(at index: IndexSet.Element, to newIndex: IndexSet.Element, animated: Bool) {
|
||||
|
||||
self.base?.moveSection(index, toSection: newIndex)
|
||||
|
||||
MainActor.assumeIsolated {
|
||||
|
||||
self.base?.moveSection(index, toSection: newIndex)
|
||||
}
|
||||
}
|
||||
|
||||
public func deleteItems(at indexPaths: [IndexPath], animated: Bool) {
|
||||
|
||||
self.base?.deleteItems(at: indexPaths)
|
||||
|
||||
MainActor.assumeIsolated {
|
||||
|
||||
self.base?.deleteItems(at: indexPaths)
|
||||
}
|
||||
}
|
||||
|
||||
public func insertItems(at indexPaths: [IndexPath], animated: Bool) {
|
||||
|
||||
self.base?.insertItems(at: indexPaths)
|
||||
|
||||
Internals.mainActorImmediate {
|
||||
|
||||
self.base?.insertItems(at: indexPaths)
|
||||
}
|
||||
}
|
||||
|
||||
public func reloadItems(at indexPaths: [IndexPath], animated: Bool) {
|
||||
|
||||
self.base?.reloadItems(at: indexPaths)
|
||||
|
||||
Internals.mainActorImmediate {
|
||||
|
||||
self.base?.reloadItems(at: indexPaths)
|
||||
}
|
||||
}
|
||||
|
||||
public func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath, animated: Bool) {
|
||||
|
||||
self.base?.moveItem(at: indexPath, to: newIndexPath)
|
||||
|
||||
Internals.mainActorImmediate {
|
||||
|
||||
self.base?.moveItem(at: indexPath, to: newIndexPath)
|
||||
}
|
||||
}
|
||||
|
||||
public func performBatchUpdates(updates: () -> Void, animated: Bool, completion: @escaping () -> Void) {
|
||||
|
||||
self.base?.performBatchUpdates(updates, completion: { _ in completion() })
|
||||
public func performBatchUpdates(updates: @escaping @Sendable () -> Void, animated: Bool, completion: @escaping @Sendable () -> Void) {
|
||||
|
||||
Internals.mainActorImmediate {
|
||||
|
||||
self.base?.performBatchUpdates(updates, completion: { _ in completion() })
|
||||
}
|
||||
}
|
||||
|
||||
public func reloadData() {
|
||||
|
||||
self.base?.reloadData()
|
||||
|
||||
Internals.mainActorImmediate {
|
||||
|
||||
self.base?.reloadData()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user