PHAsset: What is 'assetSource'?

2019-08-05 05:20发布

问题:

I am enumerating a PHFetchResult. If I do a println on the PHAssets being returned, I get this:

<PHAsset: 0x178192140> 4CBE5A4F-90BD-438B-954E-6FF1B14538CD/L0/001 mediaType=1/0, assetSource=3, (2448x3264), creationDate=2014-10-15 14:20:12 +0000, location=1, hidden=0, favorite=1

Does anyone know what the assetSource=3 bit is? I would like to run a predicate on the assetSource if possible but can't find any information anywhere on what it is or how to access it. Is it private?

回答1:

assetSource is a private variable, so its meaning is purposefully opaque.

You could use a predicate to filter on assetSource from its description to investigate further, like in this question, but it'd be a purely academic exercise.



回答2:

maybe related to upcoming PHAssetSourceType in iOS9.

struct PHAssetSourceType : OptionSetType {
init(rawValue rawValue: UInt)
static var TypeNone: PHAssetSourceType { get }
static var TypeUserLibrary: PHAssetSourceType { get }
static var TypeCloudShared: PHAssetSourceType { get }
static var TypeiTunesSynced: PHAssetSourceType { get }

}

refer to https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAsset_Class/index.html#//apple_ref/swift/struct/c:@E@PHAssetSourceType