Presentation is loading. Please wait.

Presentation is loading. Please wait.

Create a Web View App Step-by-Step. Step 1 Create a new project in XCode using the "Single View Application" option.

Similar presentations


Presentation on theme: "Create a Web View App Step-by-Step. Step 1 Create a new project in XCode using the "Single View Application" option."— Presentation transcript:

1 Create a Web View App Step-by-Step

2 Step 1 Create a new project in XCode using the "Single View Application" option.

3 Step 2 Modify “viewcontroller.h” #import @interface ViewController : UIViewController { IBOutlet UIWebView *webDisplay; } @property(nonatomic,retain) UIWebView *webDisplay; @end

4 Step 3 Create the User Interface Double click on MainStoryboard.storyboard and open it to Interface Builder. Drag "Web View" from the library and place into view. Connect the UIWebView code to the Web View GUI.

5 Step 4 Open ViewController.m In viewDidLoad we will create a URL request object and load the request in the UIWebView.

6 Step 4 – Add the following code - (void)viewDidLoad { NSString *urlAddress = @"http://www.itu.edu"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webDisplay loadRequest:requestObj]; [super viewDidLoad]; }

7 Step 5 Compile your application and run in the Simulator.


Download ppt "Create a Web View App Step-by-Step. Step 1 Create a new project in XCode using the "Single View Application" option."

Similar presentations


Ads by Google