Walt Disney once said, “there is no magic in magic, it’s all in the details.” The same is very much true of SwiftUI: it’s easy to look at it and think there’s all sorts of magic happening to make it work so efficiently, when really if you look behind the curtain you’ll start to see exactly how it works – and in doing so gain a better understanding of how to use it.
Today is our first technique project, and we’re focusing on two fundamental components of SwiftUI: views and modifiers. We’ve been using these already, but we’ve kind of glossed over exactly how they work. Well, that ends today: we’ll be going through lots of details about what they are, how they work, and why they work as they do.
If everything goes to plan, the end result will be lots less magic and lots more detail – you’ll still enjoy using SwiftUI, but you’ll know exactly what makes it tick.
Today you have 10 topics to work through, in which you’ll learn to build custom view modifiers and custom containers, as well as start to develop your understanding of how SwiftUI actually works internally.
That’s a huge chunk of learning, but if you’re keen for more I have one bonus tutorial for you – it’s optional, so only complete this if you have the time: Custom containers.
If you use Twitter, the button below will prepare a tweet saying you completed today, along with a celebratory graphic, the URL to this page, and the challenge hashtag. Don't worry – it won't be sent until you confirm on Twitter!
Need help? Tweet me @twostraws!
SAVE 50% To celebrate Black Friday, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
Link copied to your pasteboard.