My Application tries to import an image from photos and adds to an album.
But in latest swift changes. addAssets() accepts parameter as NSFastEnumeration. So I get an error as shown in the image.
even the Apple API document has this same code: https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAssetChangeRequest_Class/index.html#//apple_ref/occ/instp/PHAssetChangeRequest/placeholderForCreatedAsset
What is the alternative or how do I addAssets now?
So, I did some research, and according to NSHipster,
NSEnumeration
is a protocol implemented byNSArray
,NSSet
, andNSDictionary
. This suggests that if you convert[assetPlaceholder]
to anNSArray
, you'll be able to use it in the method. And, in fact, this compiles: