|< Answering the big question: should you learn SwiftUI, UIKit, or both?||Migrating from UIKit to SwiftUI >|
Updated for Xcode 13.2
This guide is called SwiftUI by Example, because it focuses particularly on providing as many examples as possible, with each one solving real problems you’ll face every day.
I have literally tried to structure this so that almost every entry starts with “How to…” because this is about giving you hands-on code you can use in your own projects immediately. That also means I’ve tried to get to the point as fast as possible and stay there, so if you’re looking for a longer, slower introduction to SwiftUI I’m afraid this isn’t it.
If you’ve already grabbed the basics of SwiftUI and just want code that solves your problems, by all means just jump in wherever interests you.
My code examples are specifically written for folks who are following along more or less linearly, so if you’re want to make those changes you may need to do a little light editing to make it fit your code.
If you’re just starting out with SwiftUI you should read this guide in a roughly linear order – just keep reading and clicking Next until you’re done. As far as possible I’ve written the guide so that later chapters build on earlier ones, so a linear approach really is a good idea.
If this is you, you should start by creating a new iOS app using the App template. It doesn’t matter what you call it, but I would like you to make sure and select SwiftUI for your interface and SwiftUI App for your life cycle, otherwise the rest of this guide will be very confusing indeed.
SAVE 50% This 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.