Modifying the Current Selection
There are a number of WebView editing methods that allow you to modify the current selection. For example, you can replace the current selection with plain text as follows:
[webView replaceSelectionWithText:@”SomeString”]; |
You can replace the current selection with a styled string as follows:
NSString *markupString = [NSString stringWithFormat: |
@"<span style='color: red; font-style: italic'>%@</span>", |
@”SomeString”]; |
[webView replaceSelectionWithMarkupString:markupString]; |
Copyright © 2003, 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-11-09