I try to use the enumerateGroupsWithTypes
method of the ALAssetsLibrary
class but I get an error with the first parameter.
The method's prototype :
func enumerateGroupsWithTypes(types: ALAssetsGroupType,
usingBlock enumerationBlock: ALAssetsLibraryGroupsEnumerationResultsBlock!,
failureBlock: ALAssetsLibraryAccessFailureBlock!)
How I call this method :
assetLib.enumerateGroupsWithTypes(ALAssetsGroupAll, usingBlock: success, failureBlock: fail)
but I get a compile error 'CUnsignedInt' is not convertible to 'ALAssetsGroupType'
Other tests :
Based on what I've found on internet and my own tests, I've also tried
Test 1
assetLib.enumerateGroupsWithTypes(ALAssetsGroupAll as ALAssetsGroupType, usingBlock: success, failureBlock: fail)
And the result is a compile error Cannot convert the expression's type 'Void' to type 'ALAssetsGroupType'
Test 2
assetLib.enumerateGroupsWithTypes(ALAssetsGroupType(ALAssetsGroupAll), usingBlock: success, failureBlock: fail)
And the result is a runtime error EXC_BAD_ACCESS
and an XCode crash.