Day 59 - SwiftUI Project-12 Challenge and Solutions
Table of Contents
While this is just an introduction to what SwiftData can do, you’ve seen how it can add, delete, sort, filter and more with relatively simple code. Yes, some parts of Swift are a bit fuzzy - #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 is guaranteed to be there for all applications on all of Apple’s platforms. This means you can use it for whatever your needs are: maybe it’s for saving important data, maybe it’s just a cache of the content you download; it doesn’t matter, because SwiftData will do a great job of managing it for you.
Challenge #
All three of these challenges are related to your upgrade of project-7, iExpense:
- Start by upgrading to use SwiftData.
- Add a customizable sort order option: by name or by amount.
- Add a filter option to show all expenses, only personal expenses or only business expenses.
Solutions #
The code for the completed project for the above three items is available in the following github repository.
GitHub - GorkemGuray/iExpense at Day59_Challange_1
You can also read this article in Turkish.
Bu yazıyı Türkçe olarak da okuyabilirsiniz.