dimanche 12 février 2017

Get screenshot count in swift

Vote count: 0

I am new to Swift and am trying to make a function that simply returns the number of photos in your screenshot album using fetchAssetCollections

I have

func getNumScreenshots() -> Int {

    let collection:PHFetchResult =  
     PHAssetCollection.fetchAssetCollections(with: .album, subtype:.smartAlbumScreenshots, options: nil)

    return collection.count
}

However, this is always returning 3, and I'm not sure why (I have 600 screenshots on my iPhone).

asked 39 secs ago

Let's block ads! (Why?)



Get screenshot count in swift

Aucun commentaire:

Enregistrer un commentaire