I’d like to make an app where you pick a face from Apple’s Photos app, and the app explores those photos on a map.
So far, I’ve figured out that this query returns a single PHCollectionList
named “People”:
let peopleFolder = PHCollectionList.fetchCollectionLists(
with: .smartFolder,
subtype: .smartFolderFaces,
options: nil).firstObject!
... but I don’t see a way to get the faces inside this folder. Here are the queries I’ve tried so far:
let people1 = PHCollectionList.fetchCollections(in: peopleFolder, options: nil)
let people2 = PHCollection.fetchCollections(in: peopleFolder, options: nil)
let people3 = PHAssetCollection.fetchCollections(in: peopleFolder, options: nil)
...but all three of these return empty PHFetchResult
s.
Is there a way to get a list of the Faces in a user’s Photos library?