< Previous PageNext Page > Hide TOC

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];


< Previous PageNext Page > Hide TOC


© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.