Created
August 30, 2018 11:14
-
-
Save acotilla91/7df152c636adb0606a1821c8c5eb91c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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