altinkonlineConcrete5 Xcode

Fast Scrolling UIWebView


You use the UIWebView class to embed web content in your application. To do so, you simply create a UIWebView object, attach it to a window, and send it a request to load web content. You can also use this class to move back and forward in the history of webpages, and you can even set some web content properties programmatically.

You can download a sample in Xcode from the projectpage.

In this tutorial you would learn to make an UIWebView fast scrolling!


Create a new group into your project folder and call it 'xotool'.

Download de compressed 'xotool' folder from the projectpage. Uncompress the downloaded .zip file and drag the files in the xotool group, inside your project folder. Set the option 'Copy items into destination group's folder (if needed)' checked. Click on 'Finish'.

And now it's time to write code.


First import the before added xotool to your project. Open the implementation file for the class in wich you want to use the xotool. Eg 'RootViewController.m'.

// Add this line on top of your implementation file
#import "xotool.h"

Now you're ready to use xotool. Open your implementation file to make the UIWebView transparent. Merge the following code with the viewDidLoad: method of your implementation file. Replace 'theWebView' with your UIWebView object.

// Make fast scrolling webview
setDecelerationRateForWebview(theWebView, UIScrollViewDecelerationRateNormal);

Now you are ready to use your fast scrolling UIWebView!

Comments:

Leave a Reply



(Your email will not be publicly displayed.)