Projects 7, 8, and 9 were the first in the series I consider to be “hard”: you had to parse JSON data, you had to create a complex layout for 7 Swifty Words, and you took your first steps towards creating multithreaded code – code that has iOS do more than one thing at a time.
None of those things were easy, but I hope you felt the results were worth the effort. And, as always, don’t worry if you’re not 100% on them just – we’ll be using Codable
and GCD more in future projects, so you’ll have ample chance to practice.
UITabBarController
, which is another core iOS component – you see it in the App Store, Music, iBooks, Health, Activity, and more.UITabBarItem
that has a title and icon. If you want to use one of Apple’s icons, it means using Apple’s titles too. Data
to load a URL, with its contentsOf
method. That then got fed to JSONDecoder
so that we could read it in code.WKWebView
again, this time to show the petition content in the app. This time, though, we wanted to load our own HTML rather than a web site, so we used the loadHTMLString()
method.didSet
. This meant that whenever the score
property changed, we automatically updated the scoreLabel
to reflect the new score.DispatchQueue
, and also met the performSelector(inBackground:)
method, which is the easiest way to run one whole method on a background thread.enumerated()
for looping through arrays, joined()
for bringing an array into a single value, and replacingOccurrences()
to change text inside a string.GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.