Search code examples
iosswiftphotokit

Get list photo when setting new permission `Limit` in ios 14


I use code for get list image

let options = PHFetchOptions()
options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
options.predicate = NSPredicate(format: "mediaType == %d", PHAssetMediaType.image.rawValue)
return PHAsset.fetchAssets(with: options)

But in permission Limit in ios 14 this will get all image. enter image description here

Just get only limit photo.


Solution

  • I had the same problem. It only occurs in the simulator. You can try it on a real device. It's probably a bug in the simulator.