The declare (Did not write this myself):
Declare Sub UIImageWriteToSavedPhotosAlbum Lib “UIKit” _
(img As ptr, target As ptr, sel As ptr, info As ptr)
Did you happen to enable the Photos Access capability in the iOS Advanced Tab?
I used code that looks like this:
Declare Sub UIImageWriteToSavedPhotosAlbum Lib "UIKit" (img As Ptr, target As Ptr, sel As Ptr, info As Ptr)
Var p As Ptr = pic.CopyOSHandle(picture.HandleType.iOSUIImage)
UIImageWriteToSavedPhotosAlbum(p, Nil, Nil, Nil)
and as long as I also have the Photos Access capability enabled, it works just fine. Otherwise it crashes the app (Apple Security)
From looking at the documentation you will need to make a Xojo class that adds the selector as a member and then catch the call. An iOSBlock will not do what you need. In iOSKit you can look for the use of BuildTargetClass which is how you’ll have to do it.
Hi Bob,
Did you get this working?
I tried to implement the method but compile error says UIKit doesn’t exist
Declare Sub UIImageWriteToSavedPhotosAlbum Lib “UIKit” (img As ptr, target As ptr, sel As ptr, info As ptr)
I did, but the error message: Declares direct into the runtime via Lib “” are no longer allowed suggests something has changed. What version of Xojo are you using? My work was in an earlier version. I need to move the project to the latest version to get it ready for the App Store.