AssetsPickerViewController
AssetsPickerViewController copied to clipboard
Couldn't get any LivePhoto or other subMedia types album
I used following code to get all livePhotos only. But it doesn't work and show empty gallery.
var assetsPicker = AssetsPickerViewController()
let config = AssetsPickerConfig()
let options = PHFetchOptions()
options.predicate = NSPredicate(format: "mediaType = %d", PHAssetCollectionSubtype.smartAlbumLivePhotos.rawValue)
options.sortDescriptors = [NSSortDescriptor(key: "duration", ascending: true)]
config.assetFetchOptions = [
.smartAlbum: options,
.album: options
]
assetsPicker.pickerConfig = config