I need to show a paginated slideshow of moderately DOM-intensive HTML pages in an iPad application.
All documents are tailored for iPad screen so there is never any scrolling inside UIWebView
s.
I decided to put UIWebView
s inside UIScrollView
for pagination.
It works really well and smooth after all web views have rendered their content.
However, I can't afford waiting for 20, 30 or 50 web views to load before user can scroll: it takes minutes.
I tried to anticipate swipes in scrollViewDidScroll
handler and pre-load a few next pages as user keep scrolling.
This worked much better (no performance difference between 10 or 150 web views).
However calling loadHTMLString
in scrollViewDidScroll
handler causes scrolling to lose it smoothness.
I don't care if it takes a second longer to show a particular UIWebView
βall I want is for scrolling to be smooth and available as soon as possible, and to lazily preload UIWebView
s on the go.
How do I achieve that?