Synchronized surfing in iOS (Javascript, UIWebView and Objective-C video demo)




Following the last blog post on using Javascript as a means of communication between the contents of a UIWebView and the main thread of Objective-C in Xcode, I just wanted to post this proof of concept from the iOSSimulator.

Here two web views are placed side-by-side. When the left view scrolls down the page the right one follows, but when it goes back towards the top the right one stays where it is until it passes where the right one had stopped and then resumes.

The right web view can be scrolled entirely independently of the left one but then when the left view is scrolled again it syncs the position of the right one if it is at a point earlier in the article to the left one.

Watch the video to make sense of this.

If you'd like to know more then catch up with me on Twitter at @anthonylevings or @sketchytech

Comments