Suppose - User has selected & copied some text in textField/textView/webView.
Now I want to Log the copied text, But don't know how?
How is it possible?
Sagar
Suppose - User has selected & copied some text in textField/textView/webView.
Now I want to Log the copied text, But don't know how?
How is it possible?
Sagar
My guess would be to use the UIPasteBoard function: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIPasteboard_Class/Reference.html
Hope that helps!
Ok, here you go Sagar... It would be wise for you to research how this works though:
This code to Copy strings to the pasteBoard:
-(IBAction)copyStringToPasteBoard{
UIPasteboard *appPasteBoard = [UIPasteboard pasteboardWithName:@"CopyFrom" create:YES];
appPasteBoard.persistent = YES;
NSString *yourCopiedText = @"YOUR TEXT HERE";
NSLog(@"\n Your String: %@",appPasteBoard.string);
[appPasteBoard setString:textView.text];
}
I hope this is more specific for you, please vote me up ^.^
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
if ([pasteboard containsPasteboardTypes: [NSArray arrayWithObject:@"public.utf8-plain-text"]]) {
NSLog(@"WE gots a string which is: %@", pasteboard.string);
}
Hope this help! ;)