Software Dev

Why asynchronous programming is (was) hard

One of the most difficult things about mobile development is asynchronous programming, which means doing different things at the same time. This is not the normal flowchart-style sequence of traditional programming.

Weirdly enough, with Swift completion handlers, an asynchronous function exits before it finishes. Or if you’r not careful, it might never finish at all. 🀯

Oh no! This is entering annoying quantum mechanics territory. 😭

If none of this makes any sense to you, then you’re not alone.

All of this is why I love the following video from WWDC 2021. Nate spends the first eight minutes showing how downloading an image and generating a thumbnail quickly becomes “verbose, complex, and even incorrect” in traditional Swift programming. (Side note: I like how Nate apparently worked hard on his hand gestures as well.)

The payoff: Nate then explains how async/await will let you write asynchronous code basically like “regular code.” 🀩

Software Dev

Unofficial Sandwiches

I love the idea and name of this project.

Apple demonstrated how to build an app with SwiftUI by doing a detailed walk-through a Sandwiches app.

πŸ‘‰ Introduction to SwiftUI

But they didn’t give you the code! I guess that’s because they want you to write it yourself. πŸ€·πŸ»β€β™‚οΈ

Still, here is a working unofficial version of the Sandwiches app developed to help you along.

πŸ‘‰ GitHub: Unofficial Sandwiches

Via iOS Dev Weekly.