mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 22:30:34 +01:00
Add utility for DiffableDataSources to create an empty snapshot for custom list construction
This commit is contained in:
@@ -154,6 +154,17 @@ extension DiffableDataSource {
|
||||
completion: completion
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a new empty `ListSnapshot` suitable for building custom lists inside subclass implementations of `apply(_:animatingDifferences:completion:)`.
|
||||
*/
|
||||
public func makeEmptySnapshot() -> ListSnapshot<O> {
|
||||
|
||||
return .init(
|
||||
diffableSnapshot: .init(),
|
||||
context: self.dataStack.unsafeContext()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the number of sections
|
||||
|
||||
Reference in New Issue
Block a user