我是 Swift 的新手,我正在尝试创建一个函数,使用 fetchAssetCollections 简单地返回截图相册中的照片数量
我有
func getNumScreenshots() -> Int {
let collection:PHFetchResult =
PHAssetCollection.fetchAssetCollections(with: .album, subtype:.smartAlbumScreenshots, options: nil)
return collection.count
}
但是,这总是返回 3,我不知道为什么(我的 iPhone 上有 600 个屏幕截图)。