<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Search and highlight text in UIWebView</title>
	<atom:link href="http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/</link>
	<description>iCab related stuff; Mac, iPhone and Cocoa programming</description>
	<lastBuildDate>Fri, 03 Feb 2012 21:00:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20719</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Fri, 03 Feb 2012 21:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20719</guid>
		<description>It looks like the UC Browser only uses the standard contextual menu of UIWebView, and this does always work, even with cross-domain iframes. But it only has the items &quot;Copy &quot; and &quot;Open&quot;.</description>
		<content:encoded><![CDATA[<p>It looks like the UC Browser only uses the standard contextual menu of UIWebView, and this does always work, even with cross-domain iframes. But it only has the items &#8220;Copy &#8221; and &#8220;Open&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20707</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 03 Feb 2012 11:44:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20707</guid>
		<description>@Alexander
Did you hear about UC Web Browse? A Chinese company&#039;s product, it can show the context menu when you long press at the cross-domain-iframe area. I don&#039;t know how they do that. They announce that they has their own web-engine base on webkit, and the html5test shows that UC&#039;s scores is different from the safari mobile. But I&#039;m not sure if they REALLY use their own engine.</description>
		<content:encoded><![CDATA[<p>@Alexander<br />
Did you hear about UC Web Browse? A Chinese company&#8217;s product, it can show the context menu when you long press at the cross-domain-iframe area. I don&#8217;t know how they do that. They announce that they has their own web-engine base on webkit, and the html5test shows that UC&#8217;s scores is different from the safari mobile. But I&#8217;m not sure if they REALLY use their own engine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20706</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Fri, 03 Feb 2012 11:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20706</guid>
		<description>@Alex
No, Apple does not allow other web engines. You have to use the one that is built.in in the iOS.</description>
		<content:encoded><![CDATA[<p>@Alex<br />
No, Apple does not allow other web engines. You have to use the one that is built.in in the iOS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coder</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20695</link>
		<dc:creator>coder</dc:creator>
		<pubDate>Fri, 03 Feb 2012 04:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20695</guid>
		<description>Thanks Alexander, I considered your solution but thought could be time consuming for large html files in fact what I did is I stored the set of words to be searched for in an array and as I go over the nodes recursively I check the words in the array consecutively if one fails I restore the index to start the search for the words all over again, if all the nodes verify the words consecutively so its a match. The hard part was to delete the words and replace them highlighted ones but at the end it worked.
Thank you very much for your solution it also inspired me for other functions.</description>
		<content:encoded><![CDATA[<p>Thanks Alexander, I considered your solution but thought could be time consuming for large html files in fact what I did is I stored the set of words to be searched for in an array and as I go over the nodes recursively I check the words in the array consecutively if one fails I restore the index to start the search for the words all over again, if all the nodes verify the words consecutively so its a match. The hard part was to delete the words and replace them highlighted ones but at the end it worked.<br />
Thank you very much for your solution it also inspired me for other functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20682</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 03 Feb 2012 00:22:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20682</guid>
		<description>Thanks Alexander, does Apple allow apps to build their own webkit themself?</description>
		<content:encoded><![CDATA[<p>Thanks Alexander, does Apple allow apps to build their own webkit themself?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20662</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Thu, 02 Feb 2012 13:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20662</guid>
		<description>@Alex
Yes, for different domains, there&#039;s no solution. In this case you can&#039;t do anything,</description>
		<content:encoded><![CDATA[<p>@Alex<br />
Yes, for different domains, there&#8217;s no solution. In this case you can&#8217;t do anything,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20656</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 02 Feb 2012 11:10:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20656</guid>
		<description>Thanks Alexander.
yeah,  I did it as you said, but it doesn&#039;t work in this situation: the main page and the iFrame/Frame page are from different domain.
I try to find some cross-domain solution, but i get nothing.
it seems need to call the private APIs of webkit. but Apple not allow to do this.
It made me mad!</description>
		<content:encoded><![CDATA[<p>Thanks Alexander.<br />
yeah,  I did it as you said, but it doesn&#8217;t work in this situation: the main page and the iFrame/Frame page are from different domain.<br />
I try to find some cross-domain solution, but i get nothing.<br />
it seems need to call the private APIs of webkit. but Apple not allow to do this.<br />
It made me mad!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20629</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Wed, 01 Feb 2012 12:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20629</guid>
		<description>@Alex
Search frames is done in the same way as searching the main document. You only need to iterate through all of the frames and search here in the same way. frames are also &quot;window&quot; objects in JavaScript. And the &quot;document&quot; property that is used in my code directly is just a short form for &quot;window.document&quot;, so you can use this document for frame objects as well.
To get the frames of a window (or frame) use the &quot;frames&quot; property of this window object (window.frames). This property is an array and lists all frames of that window/frame.</description>
		<content:encoded><![CDATA[<p>@Alex<br />
Search frames is done in the same way as searching the main document. You only need to iterate through all of the frames and search here in the same way. frames are also &#8220;window&#8221; objects in JavaScript. And the &#8220;document&#8221; property that is used in my code directly is just a short form for &#8220;window.document&#8221;, so you can use this document for frame objects as well.<br />
To get the frames of a window (or frame) use the &#8220;frames&#8221; property of this window object (window.frames). This property is an array and lists all frames of that window/frame.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20628</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Wed, 01 Feb 2012 12:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20628</guid>
		<description>@coder
Searching will be more difficult in this case. You need to keep track of partly found search terms and check if adjacent text nodes contain the other parts of the search term. There are multiple ways to implement this. None is really simple. One simple approach might be to first combine all texts in all nodes into a single string, and also create a list or array of nodes and offsets which will tell you where within this string the nodes of the HTML string are starting and ending. This way the searching is easy, because you only have one single string. and getting to the actual nodes is also not that complicated anymore.</description>
		<content:encoded><![CDATA[<p>@coder<br />
Searching will be more difficult in this case. You need to keep track of partly found search terms and check if adjacent text nodes contain the other parts of the search term. There are multiple ways to implement this. None is really simple. One simple approach might be to first combine all texts in all nodes into a single string, and also create a list or array of nodes and offsets which will tell you where within this string the nodes of the HTML string are starting and ending. This way the searching is easy, because you only have one single string. and getting to the actual nodes is also not that complicated anymore.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20619</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 01 Feb 2012 07:42:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20619</guid>
		<description>Hi, Alexander,
I got a problem, how to search the text in iFrame/Frameset? 
Thanks!</description>
		<content:encoded><![CDATA[<p>Hi, Alexander,<br />
I got a problem, how to search the text in iFrame/Frameset?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coder</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20590</link>
		<dc:creator>coder</dc:creator>
		<pubDate>Tue, 31 Jan 2012 10:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20590</guid>
		<description>Hy again! Old problem solved and another problem occured. If the nodes in my html file are made of one word each, how can modify the search so I can search for several words together.
thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hy again! Old problem solved and another problem occured. If the nodes in my html file are made of one word each, how can modify the search so I can search for several words together.<br />
thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srinivas</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20121</link>
		<dc:creator>srinivas</dc:creator>
		<pubDate>Wed, 18 Jan 2012 12:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20121</guid>
		<description>thanks alexander for your clarification,
i am also against this option but client wants it :(

one suggestion: impliment threaded views from wp admin area so that comments looks well and easy to understand.

thanks</description>
		<content:encoded><![CDATA[<p>thanks alexander for your clarification,<br />
i am also against this option but client wants it <img src='http://www.icab.de/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>one suggestion: impliment threaded views from wp admin area so that comments looks well and easy to understand.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coder</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-20119</link>
		<dc:creator>coder</dc:creator>
		<pubDate>Wed, 18 Jan 2012 10:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-20119</guid>
		<description>hy, Thank you for this blog, for posting the code and for the clear explanation, it was extremely useful, but what I need is to search in several html files not only one, I was wondering if it was doable, and if u give me a hint for doing it, 
Thanks again.</description>
		<content:encoded><![CDATA[<p>hy, Thank you for this blog, for posting the code and for the clear explanation, it was extremely useful, but what I need is to search in several html files not only one, I was wondering if it was doable, and if u give me a hint for doing it,<br />
Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-19943</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Fri, 13 Jan 2012 18:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-19943</guid>
		<description>@srinivas
IMHO, zooming should be done as in any other App by pinch gestures or by double-tapping. Using buttons is probably not the best way to do this.

Changing the zoom level manually is not that easy. You can do this by adding or changing a META tag for the &quot;viewport&quot; in the HTML code. Also the following Javascript code should work: document.body.style.zoom=10;</description>
		<content:encoded><![CDATA[<p>@srinivas<br />
IMHO, zooming should be done as in any other App by pinch gestures or by double-tapping. Using buttons is probably not the best way to do this.</p>
<p>Changing the zoom level manually is not that easy. You can do this by adding or changing a META tag for the &#8220;viewport&#8221; in the HTML code. Also the following Javascript code should work: document.body.style.zoom=10;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srinivas</title>
		<link>http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/comment-page-5/#comment-19932</link>
		<dc:creator>srinivas</dc:creator>
		<pubDate>Fri, 13 Jan 2012 13:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=110#comment-19932</guid>
		<description>hi,
i am using your code in my app and i want to add two button for zoom in and zoom out
when clicked on, webview text should zoom in or out

how can i do this?

please tell me.

thanks</description>
		<content:encoded><![CDATA[<p>hi,<br />
i am using your code in my app and i want to add two button for zoom in and zoom out<br />
when clicked on, webview text should zoom in or out</p>
<p>how can i do this?</p>
<p>please tell me.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

