get selected text from a uiwebview Xcode
问题 I have a UIWebView that loads text from an htmlString . I need when the user selects a part of the text and presses a button, i will be capable of extracting it in order to use it elsewhere, so i am using this code : // The JS File NSString *filePath = [[NSBundle mainBundle] pathForResource:@"HighlightedString" ofType:@"js" inDirectory:@""]; NSData *fileData = [NSData dataWithContentsOfFile:filePath]; NSString *jsString = [[NSMutableString alloc] initWithData:fileData encoding