- (void)viewDidLoad
{
[self.view addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:selfaction:@selector(pasteBoard:)]];
}
- (void)pasteBoard:(UILongPressGestureRecognizer*)longPress {
if (longPress.state == UIGestureRecognizerStateBegan) {
UIPasteboard*pasteboard = [UIPasteboardgeneralPasteboard];
pasteboard.string=@"需要复制的文本";
}
}