2

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 PHFetchResults.

Is there a way to get a list of the Faces in a user’s Photos library?

bryanjclark
  • 6,247
  • 2
  • 35
  • 68

1 Answers1

0

My best guess is that Apple does not want application access to this information as it is highly private information. I suggest to file a radar and hope that they open this up with some application privilege in a future macOS version.

Another option is to access the sqlite database file from the Photos library directly on disk (as suggested here How to access People album used in Apple's Photos app), but the internal format can change at any time.