Save UIImage as PNG for photo album on iPhone

I am combining some png files in uiimage and I have been following this stream ( UIImageWriteToSavedPhotosAlbum save as PNG with transparency? )

and tried to save the result as a png file, replacing this code with my image: [self composeImageWithWidth: 100 andHeight: 100) ..

When I test this with a simulator, I go to the application support folder and find the png there. However, when I test this on a real device, I cannot find the png file in my photo album.

What could be wrong? Perhaps photo album tracks?

thanks for answers

+4
source share
1 answer

You can use this function:

UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo); 

You only need to complete Target, completeSelector and contextInfo if you want to be notified when the image is saved, otherwise you can go to zero.

More info here

+4
source

Source: https://habr.com/ru/post/1392023/


All Articles