Skip to main content

Day 26

About 2 minSwiftcrashcoursepaul-hudsonswifthacking-with-swiftxcodeappstore

Day 26 ๊ด€๋ จ


100 Days of Swift - Day 26

Project 4, part three

Project 4, part three

Youโ€™ve completed another project now, and I hope youโ€™re now starting to realize how little code it takes to make iOS projects come to life.

But weโ€™re not done yet. Itโ€™s really important that you take the time to review what you learned to make sure itโ€™s sunk in, and to test out that learning with some challenges.

Thereโ€™s a Korean singer called Kwon Ji-yong โ€“ better known by the awesome stage name G-Dragon โ€“ who said, โ€œyou have to believe in yourself, challenge yourself, and push yourself until the very end; that's the only way you'll succeed.โ€

And heโ€™s right: I want you to succeed, but I also want to set you free a little to so you can try (and fail a little!) on your own. Sometimes figuring out all the wrong paths is as important as figuring out the right paths.

Today you should work through the wrap up chapter for project 4, complete its review, then work through all three of its challenges.

Wrap up

Wrap up
100 Days of Swift - Day 26 - 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.

Click here to review what you learned in project 4.open in new window

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:

  1. If users try to visit a URL that isnโ€™t allowed, show an alert saying itโ€™s blocked.
  2. Try making two new toolbar items with the titles Back and Forward. You should make them use webView.goBack and webView.goForward.
  3. 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.

Tip: 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.

Once youโ€™re done, tell other people: youโ€™ve built a web browser for iOS, youโ€™ve passed the test, and youโ€™ve even extended it with your own code.

You should be proud of what youโ€™ve accomplished โ€“ well done!