Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save acotilla91/7df152c636adb0606a1821c8c5eb91c0 to your computer and use it in GitHub Desktop.
Save acotilla91/7df152c636adb0606a1821c8c5eb91c0 to your computer and use it in GitHub Desktop.
func photos(withFaceIds faceIds: [String]) -> [Photo] {
var filteredPhotos: [Photo] = []
let faceIdsSet = Set(faceIds)
for photo in photos {
let hasFaceIds = Set(photo.faceIds).intersection(faceIdsSet).isEmpty == false
if hasFaceIds {
filteredPhotos.append(photo)
}
}
return filteredPhotos
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment