Objective c save image to gallery

I manipulated some pixels in image and now when i open the image in app, a message appears but problem is that i saved it to my document directory. I want to allow someone to share this photo. If i save the image below, the image data changes.


    UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);


If i save the image to app documents, i can't pick it with imagepicker.


    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *imagePath =[documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",self.imageName.text]];
    [UIImagePNGRepresentation(image) writeToFile:imagePath
                                                         atomically:YES];


So my question is that can i save image to gallery with a custom name or can i save image to gallery with path ?

Objective c save image to gallery
 
 
Q