Load another page in UIWebView when user swipes to the left

I am developing an iOS 4 app with iOS 5.0 SDK and XCode 4.2.

I need to make a slider that shows web pages (5 or more). I thought to add only one UIWebView

, and when the user navigates, I load another page. Maybe I can add PageControl

to show how many pages.

My problem is how to handle the remote left event and if there is a way to preload the next webpage before it is displayed. In other words, if I have three pages and now I am showing the first page, I would like to preload page two. And when the user is removed to the left and he sees page two, I would like to preload page 3.

Any hint?


Do you know what is better to make a gallery of web pages?

I tried to make an html slider but it doesn't work because it takes a long time to load the html page. Here is a related question: Unsorted List: Loading images or sections on demand


source to share

1 answer

I think the simplest approach is to make the UIScrollView with horizontal scrolling and paging enabled. Then you can put a webview on each scroll page and use a delegate:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView


You can start loading web pages on user scrolling!



All Articles