WebView Application In iPad

In this application we will displayed the WebView in the Screen. Let see how it will be worked in the iPad.

Step 1: Create a new Xcode project using the View base application template. Give the application name “WebiPad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: xpand classes and notice Interface Builder created the WebiPadViewController class for you. Expand Resources and notice the template generated a separate nib, WebiPadViewController.xib, for the “WebiPad”.

Step 4: Open the ViewController.h file , in this we have added UIWebView for displaying the webpage. So make the following changes in the file.

 

 

 

Step 5: Double click the WebiPadViewController.xib and open it to the Interface Builder. Open the View window and drag the Web View from the library and place it to the view window. Connect File’s Owner icon to the View icon and select view. Next drag File’s Owner icon to the UIWebView and select the webDisplayiPad(See the figure 1). Now it all done, save it close it and go back to the Xcode.

Figure 1: Connection between file owner to the WebView

Step 6: Open the ViewController.m file make the following changes in the file.

 

 

 

Step 7: Now compile and run the application in the Simulator.

Figure 2: Output of the application

You can downloaded SourceCode from here WebiPad

Leave a Comment:

11 comments
James says August 8, 2010

Hello-

How can I use this for both iPhone and iPad. Works great in iPad. Just want to share on iPhone as well.

Thanks!
JF

Reply
Graham says May 6, 2011

Gee I had been having a hard time to find a webview tutorial that works, or at least one that I could get to work. Thank you Friend…
My first app is running

Reply
iCiccio says June 11, 2011

Hello,
I have to make an app for iPad, wings are a beginner, I would like to create a slitview with ertain lines containing the sections of my site, however it should display a link in detailview, so it must be a WebView.

how can I indicate for each line to display a web address?

thanks

Reply
thirupathi says August 9, 2011

Excellent Tutorial…Really you made my job simple…………….awesome

Reply
iPad 3 says December 23, 2011

Thanks Sushant. Really easy to follow tutorial and most importantly – it works.

Reply
Bram says January 17, 2012

Would someone care to update this tutorial to XCode 4.2. A few things changed in 4.2 that makes all tutorials out there simply not work and I’m having a hard time figuring out why (novice developer). Thanks.

Reply
darryn says May 4, 2012

Thanks for uploading the tutorial + source code..
I’ve been struggling to get my UIWebView up and running!! I downloaded the source code and when i ran it in the iPad simulator, the output is a blank white screen.. I checked that web view and the file’s owner are linked so that’s not the issue..Someone please help me.. it’s part of my varsity project

Reply
darryn says May 4, 2012

Thanks for uploading the tutorial + source code..
I’ve been struggling to get my UIWebView up and running!! I downloaded the source code and when i ran it in the iPad simulator, the output is a blank white screen.. I checked that web view and the file’s owner are linked so that’s not the issue..Someone please help me.. it’s part of my varsity project

Reply
Add Your Reply