Listening clipboard ten minutes, when the application is running in the background
#import "VIClipboardListener.h"
VIClipboardListenerDelegate
, and the method - (void)pasteboardChanged:(UIPasteboard *)generatePasteboard
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[[VIClipboardListener share] setDelegate:self];
[[VIClipboardListener share] startListener];
}
- (void)pasteboardChanged:(UIPasteboard *)generatePasteboard {
//Get pasteboard's String/URL/Image/Color
//And save the data or do anything else...
NSLog(@"The pasteboard string :%@",[UIPasteboard generalPasteboard].string);
NSLog(@"The pasteboard URL :%@",[UIPasteboard generalPasteboard].URL);
NSLog(@"The pasteboard image :%@",[UIPasteboard generalPasteboard].image);
NSLog(@"The pasteboard color :%@",[UIPasteboard generalPasteboard].color);
}