Day 59
Day 59 ๊ด๋ จ
Project 12, part 3
Are you ready for some more challenges?
American singer and songwriter Christina Grimmie once said, โpeople aren't born strong; People grow stronger little by little, encountering difficult situations, learning not to run from them.โ The same is absolutely true of good coders: thereโs no magic switch that gets flicked when youโve been reading books for a year, but instead your skills grow slowly over time as you face โ and solve โ increasingly hard problems.
I keep encouraging you to tackle these problems because writing your own code, and finding your own solutions, matters. At first there will often be some blank page syndrome โ where you stare blankly at the screen, not knowing where to start. But thatโs OK, and in fact itโs to be expected. The more you practice the more adept youโll become at figuring out solutions for yourself, and today is another step towards that goal.
Today you should work through the wrap up chapter for project 12, complete its review, then work through all three of its challenges.
SwiftData: Wrap up
SwiftData: Wrap up
Although we've only really scratched the surface of what SwiftData can do, youโve still seen how it can add, delete, sort, filter, and more, all with relatively simple code. Yes, a few parts are a little murky in Swift โ #Predicate
, for example, can take some getting used to โ but as long as you're careful you should be fine.
Perhaps the most important thing about SwiftData is that itโs guaranteed to be there for all apps, on all of Appleโs platforms. This means you can use it regardless of your needs: maybe itโs for saving important data, maybe itโs just a cache of content you downloaded; it doesnโt matter, because SwiftData will do a great job of managing it for you.
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. Itโs my job to make sure you take as much from these tutorials as possible, so Iโve prepared a short review to help you check your learning.
Click here to review what you learned in this project.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try extending this app to make sure you fully understand whatโs going on.
All three of these challenges relate to you upgrade project 7, iExpense:
- Start by upgrading it to use SwiftData.
- Add a customizable sort order option: by name or by amount.
- Add a filter option to show all expenses, just personal expenses, or just business expenses.
SwiftData: Wrap up - Additional