vignesh.P vignesh.P - 2 years ago 156
Swift Question

copy image from sandbox and paste it to iPad/ iphone internal memory

I've using

uiimagepickercontroller
and taken images via camera and stored into folder that was created in sandbox. That stored images are not displayed in iPads or iPhone photo gallery. I want to display those sandbox pictures in device gallery. Any one help me out from this.
My optimum goal is to copy image from sandbox and paste it to device's internal memory.

Thanks in advance..

Answer Source

You use the UIImageWriteToSavedPhotosAlbum() function.

UIImageWriteToSavedPhotosAlbum(IMAGE_TO_STORED, nil, nil, nil);

Edit:

- (IBAction)savedPhoto:(id)sender{
    UIImageWriteToSavedPhotosAlbum(IMAGE_TO_STORED, nil, nil, nil);
}

Another way to stored image is:

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library saveImage:image toAlbum:nil withCompletionBlock:^(NSError *error) {
        if (error!=nil)
        {
            NSLog(@"Error: %@", [error description]);
        }
    }];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download