Question: I want to implement a listview, on which swiping opens up the `actions` that we can do with that item. I have attached an image.

![enter image description here](https://i.stack.imgur.com/j0ayI.jpg)

Answer: 
You can modified `saveImage` and `loadImage` function as per below. 

```
-(void)saveImage: (UIImage*)image filePath:(NSString*)fileNameEmail
{
     if (image != nil)
     {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:fileNameEmail];

        NSData* data = UIImagePNGRepresentation(image);
              [data writeToFile:filePath atomically:YES];

     }
}

- (UIImage*)loadImage:(NSString*)fileNameEmail
{
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:fileNameEmail];
     UIImage *image = [[UIImage alloc] initWithContentsOfFile:filePath];
     return image;
}

```

**Edit** : You can get specific image like below.

```
-(UITableViewCell *)tableView:(UITableView *)tableView  cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

    cell.youimageview.image = [self loadImage:[[yourArray indexOfObject:indexPath.row] valueForKey:@"youemailkey"]];
    return cell;
}

```

may this help you.
Also you can use like that,

```
-(NSString *)ImageString{

    NSData *imgdata = UIImageJPEGRepresentation(self.imgView.image, 0.5);
    NSString *imagename =[self generateImageName];

    NSFileManager *fileManager = [NSFileManager defaultManager];
    [fileManager createFileAtPath:[NSString stringWithFormat:@"%@/%@",   DOCUMENTS_FOLDER,imagename]
                         contents:imgdata
                       attributes:nil];
    return imagename;

    }
       -(NSString *)generateImageName{

        int timestamp = [[NSDate date] timeIntervalSince1970];
        NSString *StrImage = [NSString stringWithFormat:@"Image_%d.png",timestamp];
        NSLog(@"image name=%@",StrImage);
        return StrImage;
    }

```

And Define In Header like that,

```
#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]

```