Reputation: 1
Is there any way to check the media is physically available on device. In other words how to identify the iCloud media using swift or objective c.
I have tried to access below property but seems there is some issue with that.
public struct PHAssetSourceType : OptionSet {
public init(rawValue: UInt)
public static var typeUserLibrary: PHAssetSourceType { get }
public static var typeCloudShared: PHAssetSourceType { get }
public static var typeiTunesSynced: PHAssetSourceType { get }
}
Code to check iCloud media.
let assetType = (self.assets?[indexPath.row])! as PHAsset
// let sourceType = assetType.sourceType as PHAssetSourceType
if assetType.sourceType.rawValue == 2 /*.typeCloudShared*/ {
(cell as! FNSCameraRollCollectionViewCell).iCloudImage.isHidden = false
}
**OR**
if assetType.sourceType == .typeCloudShared {
(cell as! FNSCameraRollCollectionViewCell).iCloudImage.isHidden = false
}
I am getting below result :
PHAssetSourceType(rawValue: 1)
My objective is to customize the camera roll and show the icon on iCloud media.
Upvotes: 0
Views: 114