iosphotosframework

PHCollection: Fetch all albums, sorted by most-recently edited


In Apple’s Photos framework, there’s a class PHAssetCollection, which represents the Albums in a user’s library.

I’d like to fetch the albums and sort them by the date they were last edited (as in, the date that a photo was last added-to or removed-from the album) - and I’ve yet to find a way to do this.

Is there a way to write a query that returns albums sorted by most-recently-edited?


Solution

  • Is there a way to write a query that returns albums sorted by most-recently-edited?

    No. A PHAssetCollection doesn't have any property telling you its modified date, and a PHAsset doesn't have any property telling you when it was added to a collection.