fetchAssets(with:)
fetchAssets(with:)
fetchAssets(with:) Type Method of PHAsset Retrieves all assets matching the specified options.
class func fetchAssets(with options: PHFetchOptions?) -> PHFetchResult<PHAsset>Parameters
options
Options that specify a filter predicate and sort order for the fetched assets, or nil to use default options. For details, see PHFetchOptions.
Return Value
A fetch result that contains the requested PHAsset objects, or an empty fetch result if no objects match the request.
Discussion
By default, fetch results do not include photos synced to the device through iTunes or stored in iCloud Shared Albums. To change this behavior, use the includeAssetSourceTypes property in the options parameter.