fetchIdentifiers(_:batchSize:)
Returns a collection of persistent identifiers, in batches, where each identifier represents a single model that satisfies the criteria of the specified fetch descriptor.
Declaration
func fetchIdentifiers<T>(_ descriptor: FetchDescriptor<T>, batchSize: Int) throws -> FetchResultsCollection<PersistentIdentifier> where T : PersistentModelParameters
- descriptor:
A fetch descriptor that provides the configuration for the fetch.
- batchSize:
The maximum number of identifiers to include in each batch.
Return Value
The collection of persistent identifiers. If no models match the descriptor’s criteria, the array is empty.
Discussion
The collection automatically fetches subsequent batches as you iterate over the identifiers, or access one at a specific index.