Reputation: 40136
I am using PHAsset in swift. PHAssetMediaTypeImage
is not resolved. Can anyone help.
Upvotes: 1
Views: 1563
Reputation: 21137
In swift, PHAssetMediaTypeImage
is just .Image
and PHAssetMediaTypeVideo
is just .Video
:
if asset.mediaType == .Image {
}
if asset.mediaType == .Video {
}
Upvotes: 1
Reputation: 10590
Resolvable this way PHAssetMediaType.Image
and PHAssetMediaType.Video
fetch all assets, then sub fetch only the range your need
var assets = PHAsset.fetchAssetsWithMediaType(PHAssetMediaType.Image, options: fetchOptions){
}
also check apple documentation
Upvotes: 1