0

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

flo bee
  • 830
  • 2
  • 11
  • 20

1 Answers1

1

ALAssetsLibrary().saveImage(screenshot, toAlbum: "myAlbum", completion:nil, failure:nil)

Do provide selector for the function. i.e.,"myAlbum:

Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62
Srijan Kumar
  • 223
  • 1
  • 3
  • 13