Skip to content

Instantly share code, notes, and snippets.

@Zedd0202
Created April 25, 2020 16:00
Show Gist options
  • Save Zedd0202/8543aa16009a47886a135124c6514b8b to your computer and use it in GitHub Desktop.
Save Zedd0202/8543aa16009a47886a135124c6514b8b to your computer and use it in GitHub Desktop.
let albums = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .any, options: nil) // system 앨범
let albums2 = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: nil) // 사용자가 만든? 앨범
albums.enumerateObjects { (collection, _, _) in
let title = collection.localizedTitle
let count = PHAsset.fetchAssets(in: collection, options: nil).count
print(title, count)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment