Contents

fetchLimit

The maximum number of objects to include in the fetch result.

Declaration

var fetchLimit: Int { get set }

Discussion

With the default fetch limit of zero, Photos returns all requested assets or collections in a fetch result. Change this value to fetch more efficiently in situations where a potentially very large result is not needed. For example, to fetch only the most recently captured asset, call the fetchAssets(with:) method, using the sortDescriptors property to sort in descending date order, and setting a fetch limit of one.

See Also

Limiting Fetch Results