|
|
|
|
|
by asdaq1312512
902 days ago
|
|
Ahh, I did consider PHAsset.fetchAssets but my understanding was that the method will download the file if not present locally - which wouldn't be acceptable for an app, I guess. Do you know more? The introduction says "Retrieve asset metadata or request full asset content.", but I can't find clarification when it actually accesses full content. |
|
AFAICT, PHAsset is only metadata. When I'm downloading the full-sized images, I use PHImageManager.requestImage() and pass in the PHAsset I'm looking at [1][2]. I know there's something similar for video, but I've never used it.
You can control the behaviour by passing a PHImageRequestOptions instance. This includes an isNetworkAccessAllowed bool which controls where Photos.app will download the file from iCloud if not present locally, and it defaults to false.
[1]: https://developer.apple.com/documentation/photokit/loading_a...
[2]: https://developer.apple.com/documentation/photokit/phimagema...
[3]: https://developer.apple.com/documentation/photokit/phimagere...