-
Notifications
You must be signed in to change notification settings - Fork 472
Using UIWebView
Charlie Hieger edited this page Nov 6, 2015
·
18 revisions
Loading a URL into your app is as easy! Just add and configure a UIWebView.
- Drag and drop a UIWebView from the Object Library to the main view of your ViewController.
- Choose: File -> New -> File...-> iOS -> Cocoa Touch Class
- Create an outlet for the WebView by ctrl + dragging from the WebView in the Storyboard to your custom ViewController swift file.
- Above the
viewDidLoad
create a constant to hold your URL string. We will link to the DropBox mobile terms url.
let url = "https://www.dropbox.com/terms?mobile=1"
Create a String which contains your URL Convert the String to a NSURL object. Place the URL in a URL Request. Load Request