I'v thought that dealing with UIPasteboard is easy but it turned out to be a time-consuming issue...
I want to store an UIImage in UIPasteboard and then paste this image in iMessage, WhatsApp, Gmail... and others.
That's my method where I use UIPasteboard
- (void) postClipboard
{
if ([[modelView currentView] isImage])
{
UIImage *image = [self readyImageLandscape:orientationLandscape];
[[UIPasteboard generalPasteboard] setImage:image];
}
}
It works on iPhone 3GS 5.1. I've tested it on Gmail and WhatsApp
Then I modified the method to
- (void) postClipboard
{
if ([[modelView currentView] isImage])
{
UIImage *image = [self readyImageLandscape:orientationLandscape];
[[UIPasteboard generalPasteboard] setImage:image];
[[UIPasteboard generalPasteboard] setPersistent:YES];
}
}
Still works on iPhone 3GS 5.1.
But my employer says that it doesn't work on iPhone 4S 6.0 neither in WhatsApp nor in any other application.
Am I doing all wrong or there should be another approach to make it work on iPhone 4S 6.0?