init(predicate:sortBy:)
Initializes a new history descriptor with the provided predicate and sort descriptor.
Declaration
init(predicate: Predicate<TransactionType>? = nil, sortBy: [SortDescriptor<TransactionType>] = [])Parameters
- predicate:
The logical condition that determines whether the history includes a specific model in its results. The default value is
nil. - sortBy:
The array of sort descriptors that tell the history how to order its results. The default value is an empty array.
Discussion
If you don’t specify a predicate, any fetch using this descriptor will return all models of the associated type. If you expect the number of fetched transactions to be high, use fetchLimit to limit the number of transactions returned.