Today we’re starting another new project, and this is where things really start to get serious because you’ll be learning one important new Swift skill, one important new SwiftUI skill, and one important app development skill, all of which will come in useful as we build the project.
The app development skill you’ll be learning is one of Apple’s frameworks: SwiftData. It’s responsible for managing objects in a database, including reading, writing, filtering, sorting, and more, and it’s hugely important in app development for iOS, macOS, and beyond. Previously we wrote our data straight to UserDefaults
, but that was just a short-term thing to help you along with your learning – SwiftData is the real deal, used by countless thousands of apps.
Canadian software developer Rob Pike (creator of the Go programming language, member of the team that developed Unix, co-creator of UTF-8, and also published author) wrote this about data:
“Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.”
This is often shortened to “write stupid code that uses smart objects,” and as you’ll see objects don’t get much smarter than when they are backed by SwiftData!
Today you have four topics to work through, in which you’ll learn about @Binding
, TextEditor
, SwiftData, and more.
Great job on finishing another day! If you still have questions about what you learned, please send them in using this form – I'll do my best to address the most common problems in the next course update. Thank you!
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!
Alternatively, copy and paste the text below to your preferred social network - I'm @twostraws on Mastodon.social, Bluesky, and Threads.
🎉 I just finished Day 53 of the #100DaysOfSwiftUI at https://www.hackingwithswift.com/100/swiftui/53 via @twostraws
Need help? Tweet me @twostraws!
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
The 100 Days of SwiftUI is a free collection of videos, tutorials, tests, and more to help you learn SwiftUI faster. Click here to learn more, or watch the video below.
Link copied to your pasteboard.