Swift 3, would you do this?
let changeRequest = PHAssetCollectionChangeRequest(...)
let fastEnumeration = NSArray(array: [PHObjectPlaceholder])
albumChangeRequest?.addAssets(fastEnumeration)
or this?
let changeRequest = PHAssetCollectionChangeRequest(...)
albumChangeRequest?.addAssets([PHObjectPlaceholder] as NSFastEnumeration)
and what is the difference?
As you have found (your code has some inconsistency and causes other errors, better update it), you cannot use as
-casting to specify the type for Array literals as NSFastEnumeration
.
You need to find a proper class which conforms to NSFastEnumeration
, in your case it's NSArray
.
Usually write something like this:
changeRequest?.addAssets([/* needs instances, not type...*/] as NSArray)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With