UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

DAY 40

Project 9, part two


There’s an old joke about multitasking:

A programmer has a problem and thinks, “I can fix this using multitasking!”

have Now problems! two they

(Hey, I said it was old, I didn’t say it was funny!)

The point is that when you start running multiple pieces of code at the same time, they can complete in any order – the “now they have two problems!” punchline got mashed up.

In fact, race conditions are a whole category of bugs caused by one task completing before it was supposed to – they are particularly nasty to fix because sometimes work completes in the correct order and everything works great, which is why we call it a race.

Yesterday was a gentle introduction to multi-tasking using Grand Central Dispatch, but we’ll be coming back to it more in the future. In the meantime, make sure you test what you’ve learned so you can be sure it’s all sunk in.

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

Need help? Tweet me @twostraws!

 

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

100 Days of Swift


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.