Trying hard to get UIImageWriteToSavedPhotosAlbum to work in swift https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/index.html#//apple_ref/c/func/UIImageWriteToSavedPhotosAlbum
The documentation is sadly ONLY in objective C.
Here is my code:
func saveImage()
{
UIImageWriteToSavedPhotosAlbum(uiimage, self, "saveImageComplete:::", nil)
}
func saveImageComplete(image:UIImage,err:NSError,context:UnsafePointer<()>)
{
loadLastPhotoIntoGalleryIcon()
}
But the problem is that it throws the NSInvalidArgumentException with an unrecognized selector:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'app.PhotoEditor<0x14a1e400> does not respond to selector
saveImageComplete:::'
Can you advise what is wrong with my syntax and how I properly specific this selector? From what I understand, each : represents 1 argument the method expects and since it has 3 parameters I gave it 3 :'s.
Thanks!