Safari view controllers allow you to open a Safari browser window in your application without having to leave your app. In this tutorial, see why Safari view controllers are useful, and learn how to implement them.
- Let's say you want to show some kind of content…in a web browser in your application.…Well, you have two main options:…The SF Safari View Controller or WebKit.…In Apple's documentation you can see…which option you should use.…So, in the documentation I'm going to scroll down…to this section right here that says…"Choosing the Best Web Viewing Class"…And basically what it says here…is if you want to show a web page…then you should be using Safari View Controller.…
If you want to create a web browser…that controls how the user sees the website…then you you should be using the WKWebView class.…Now, a vast majority of the time…you're just going to want to show a website.…So, what we're going to be looking at in this course…is how to use a Safari View Controller…to present web content.…So, lets tab over into Xcode where I have…a very simple project created.…I have a button that says "show web content".…
And in my view controller class…I have a simple handler for that button.…So, when you click the button it runs this method.…
Instructor Todd Perkins shows how to use pickers, pop-up messages, sliders, switches, and indicators to build a sophisticated app interface, and display HTML content, files, and data with web views. Plus, learn how to dynamically update your layouts using size classes, and get a brief overview of the Apple Human Interface Guidelines.
- Picker views, controllers, sliders, and indicators
- Creating UI elements with code
- Displaying images with image views
- Creating web views to display web content
- Changing fonts, pins, and views with size classes