Skip to main content

SwiftData tutorial: Building a complete project

About 1 minSwiftArticle(s)bloghackingwithswift.comcrashcourseswiftswiftdataxcodeappstore

SwiftData tutorial: Building a complete project 관련

SwiftData by Example

Back to Home

SwiftData tutorial: Building a complete project | SwiftData by Example

SwiftData tutorial: Building a complete project

Updated for Xcode 15

This is a complete, free SwiftData tutorial designed to take you through all its core functionality in a single project. It’s aimed at people who have existing programming experience with SwiftUI, but all the SwiftData APIs and techniques are explained in detail so newcomers can to follow along.

Important

This was written for iOS 17.0, so you’ll need at least Xcode 15.0 to follow along. This is available as a free download from the Mac App Store if you don’t already have it.

The project we’ll be making is called iTour, and is a travel app that helps sightseers plan their vacation sightseeing. Users will be able to add a list of places they want to visit on their vacation, sort and search those destinations, then also add individual sights inside each place.

I’ve designed the project specifically so that it covers a variety of core SwiftData techniques to give you a good grounding in how things work. You'll learn how to define Swift data models, how to link models together using relationships, how to query and display data in SwiftUI, how to add sorting and filtering, and more.

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: twostraws/iTouropen in new window.

To get started, please create a new iOS project in Xcode called “iTour”, choosing the App template. You should also select SwiftUI for the Interface, but please leave all the checkboxes unchecked and make sure the Storage option is set to None.


이찬희 (MarkiiimarK)
Never Stop Learning.