mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-24 10:21:40 +01:00
Add utility for DiffableDataSources to create an empty snapshot for custom list construction
This commit is contained in:
@@ -155,6 +155,17 @@ extension DiffableDataSource {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
Returns the number of sections
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user