I created a command line project in XCode
I think this is a valid code in swift
let all = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary,
However when I try it now, the autocomplete does not list fetchAssetCollections
as an option.
Similar issue in my constructor
Here is the code fragment
import Foundation
import Photos
class PhotoExplorer {
init() {
PHPhotoLibrary.shared().register(self)
}
func listAssetsInPhoto() -> PHCollection {
let fetchOptions = PHFetchOptions()
PHAssetCollection.fetch // <- To be complete
}
}
Here is my build settings
I added import PhotosUI
but it does not help.
Did I do something wrong? Is there an API change?
The only way to fix it is by recreating the project.