ALAssetsLibrary-CustomPhotoAlbum icon indicating copy to clipboard operation
ALAssetsLibrary-CustomPhotoAlbum copied to clipboard

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ALAssetsLibrary saveImage:toAlbum:completion:failure:]: unrecognized selector sent to instance

Open auriga-dev opened this issue 9 years ago • 4 comments

Hi there, I'm using XCode 6.3 and Swift 1.2 and when runing the code: ALAssetsLibrary().saveImage(screenshot, toAlbum: "myAlbum", completion:nil, failure:nil)

I get the error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ALAssetsLibrary saveImage:toAlbum:completion:failure:]: unrecognized selector sent to instance

I use a bridging header to link the Objective C code with Swift

In the build phases I added the MobileCoreService and the AssetsLibrary framework

Any help would be much appreciated

auriga-dev avatar May 13 '15 18:05 auriga-dev

Have u imported the .h file appropriately to ur Swift project?

Kjuly avatar May 14 '15 00:05 Kjuly

Yes I did with a Bridging header file and inside I have:

#import "ALAssetsLibrary-CustomPhotoAlbum/ALAssetsLibrary+CustomPhotoAlbum.h"

auriga-dev avatar May 18 '15 16:05 auriga-dev

Can you make a quick demo on Swift?

auriga-dev avatar May 18 '15 20:05 auriga-dev

@auriga-dev sorry, i rarely use Swift for developing, it might take some time for doing this, and busy these days. I'm appreciate if someone else can help to do this, thx in advance :)

Kjuly avatar May 20 '15 03:05 Kjuly