Created
May 12, 2017 06:51
-
-
Save sourleangchhean168/306cfeb6bfc3332dc2da693f76d632e4 to your computer and use it in GitHub Desktop.
Get screenshot (album) count in swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let albumsPhoto:PHFetchResult<PHAssetCollection> = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .albumRegular, options: nil) | |
albumsPhoto.enumerateObjects({(collection, index, object) in | |
if collection.localizedTitle == "Screenshots"{ | |
let photoInAlbum = PHAsset.fetchAssets(in: collection, options: nil) | |
print(photoInAlbum.count) //Screenshots albums count | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment