Updated for Xcode 14.0 beta 1
This is a complete, free SwiftUI tutorial designed to take you through lots of its functionality in a single project. It’s aimed at people who have existing programming experience with UIKit, but most things are explained in detail so newcomers ought to be able to follow along.
The project we’ll be making is called iDine, and is a restaurant app that lists items in a menu and helps folks place orders. I’ve designed the project specifically so that it covers as many different techniques as possible to give you a good grounding in how things work in SwiftUI. Of course, we’re also building a real project at the same time – it’s going to be busy!
Note: If you’d like to see my completed version of this project, you can find it here on GitHub: https://github.com/twostraws/iDine.
To get started, please create a new iOS project in Xcode called “iDine”, choosing the App template. You should also select SwiftUI for the Interface, but please leave all the checkboxes unchecked.
There are quite a few assets provided for this project that you need to copy in before you start. These are all in the assets for this project, which you can download here: https://www.hackingwithswift.com/samples/idine.zip.
Please copy them into your project like this:
Codabledata from a bundle. This is not related to SwiftUI, so we won’t be covering it here.
OK, that’s it – we’re ready to go!
Tip: At the end of each chapter I’ve added a “Further reading” section that suggests links to other chapters in this book. You don’t need to read them in order to follow along; they are there to provide extra information and detail if you want to understand the bigger picture more thoroughly.
SPONSORED In-app subscriptions are a pain to implement, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app. Oh, and it's free if your app makes less than $10k/mo.
Link copied to your pasteboard.