pradeepa pradeepa - 1 year ago 91
iOS Question

How to copy UIImage data to clipboard/UIPasteboard? And how do I test it?

I tried to use the following code to copy the Image data to

on click of the Copy item in the menu.

UIPasteboard *gpBoard = [UIPasteboard generalPasteboard];
[[gpBoard setData:UIImageJPEGRepresentation(imgView.image, 1.0) forPasteboardType:UIPasteboardTypeListImage];

Which parameter i have to send for
:, and how to test after copying the data?

omz omz
Answer Source

It's a lot easier:

[UIPasteboard generalPasteboard].image = imgView.image;

To get the image out again:

UIImage *image = [UIPasteboard generalPasteboard].image;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download