Initial prototype for Swift 6 mode

This commit is contained in:
John Estropia
2026-07-07 11:18:17 +09:00
parent 38ec439b18
commit 49f65601cd
71 changed files with 998 additions and 684 deletions
@@ -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()
}
}
}
}