Wrap up
Wrap up 관련
That’s another project done, and another huge collection of things learned. You should be starting to get into the swing of things by now, but don't let yourself become immune to your achievements.
In this tutorial alone you've learned about loadView()
, WKWebView
, delegation, URL
, URLRequest
, UIToolbar
, UIProgressView
, KVO and more, so you should be proud of your fantastic accomplishments!
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. It’s my job to make sure you take as much from these tutorials as possible, so I’ve prepared a short review to help you check your learning.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try extending this app to make sure you fully understand what’s going on:
- If users try to visit a URL that isn’t allowed, show an alert saying it’s blocked.
- Try making two new toolbar items with the titles Back and Forward. You should make them use
webView.goBack
andwebView.goForward
. - For more of a challenge, try changing the initial view controller to a table view like in project 1, where users can choose their website from a list rather than just having the first in the array loaded up front.
Tips
Once you have completed project 5, you might like to return here to add in the option to load the list of websites from a file, rather than having them hard-coded in an array.