I finally figured it out.
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSData *data = [NSData dataWithContentsOfFile:filePath];
[pasteboard setData:data forPasteboardType:@"public.jpeg"];
...
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSData *data = [pasteboard dataForPasteboardType:@"public.jpeg"];
NSString *copyPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/image.jpg"];
[data writeToFile:copyPath atomically:YES];
source
share