自定义相机胶卷并在iCloud媒体上显示图标

时间:2017-08-21 06:39:26

标签: swift icloud phasset phassetcollection

有没有办法检查设备上的媒体是否可用。换句话说,如何使用swift或objective c来识别iCloud媒体。

我试图访问下面的属性,但似乎有一些问题。

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 }
}

检查iCloud媒体的代码。

 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
            } 

我的结果低于结果:

PHAssetSourceType(rawValue:1)

我的目标是自定义相机胶卷并在iCloud媒体上显示图标。

0 个答案:

没有答案