fetch(with:merge:)
Subclasses should override this method to customize a fetch request, for example to specify fetch limits.
Declaration
func fetch(with fetchRequest: NSFetchRequest<any NSFetchRequestResult>?, merge: Bool) throwsParameters
- fetchRequest:
The fetch request to use for the fetch. Pass
nilto use the default fetch request. - merge:
If True, the receiver merges the existing content with the fetch result, otherwise the receiver replaces the entire content with the fetch result.
Discussion
This method performs a number of actions that you cannot reproduce. To customize this method, you should therefore create your own fetch request and then invoke super’s implementation with the new fetch request.