Could you post your present code ?
That's a long time I did this.
Some API may have changed a bit since.
But if that can help, here is some code extract.
var phAsset : PHAsset?
var stopSearch : Bool = false // 24.9.2017 nom changé
let optionsForFetch = PHFetchOptions()
optionsForFetch.includeHiddenAssets = true
let fetchResultForPhotostream = PHAssetCollection.fetchAssetCollections(with: PHAssetCollectionType.album, subtype: PHAssetCollectionSubtype.albumMyPhotoStream, options: nil)
if fetchResultForPhotostream.count > 0 {
let photostream = fetchResultForPhotostream[0]
let fetchResultForPhotostreamAssets = PHAsset.fetchAssets(in: photostream, options: optionsForFetch)
if fetchResultForPhotostreamAssets.count >= 0 {
stopSearch = false
for i in stride(from: 0, through: fetchResultForPhotostreamAssets.count-1, by: 1) where !stopSearch {
let phAssetBeingCompared = fetchResultForPhotostreamAssets[i]
if phAssetBeingCompared.localIdentifier.range(of: localIDFragment) != nil {
phAsset = phAssetBeingCompared
stopSearch = true
}
if stopSearch { // Found the image
let photoLocation = phAsset!.location // This is the location