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