Day 38
Day 38 ๊ด๋ จ
Project 7, part 3
Thatโs another project done, and another massive amount of Swift and SwiftUI knowledge covered. There are more projects to cover, but as F1 racer Sebastian Vettel once said, โsometimes you need to press pause to let everything sink in.โ
Today is your chance to press pause and let SwiftUI sink in. Complete the review, take the challenges, and, if you need to, go back to previous consolidation day challenges and work on them.
So many people email me with questions like โhow fast can I learn app development?โ and honestly I feel sorry for them. You canโt learn when you rush. The two goals are incompatible with your brain. Focused learning is when we actively consume information through studying and thatโs really important, but diffuse learning is when we stop studying and let our brain passively make connections between what we already studied. Taking a break, sleeping, or working on something else for a while are all important parts of the process.
So, if youโre keen to rush ahead to tomorrowโs new project, please follow Vettelโs advice: press pause and let everything sink in.
Today you should work through the wrap up chapter for project 7, complete its review, then work through all three of its challenges.
iExpense: Wrap up
iExpense: Wrap up
Although the app we were building wasnโt itself difficult, getting there took quite a bit of learning โ we had to cover UserDefaults
, Codable
, sheet()
, onDelete()
, @StateObject
, and more. Some of those things โ particularly UserDefaults
and Codable
โ have only been introduced at a high level in this project, which is intentional; weโll be getting into them more later on.
Now that your SwiftUI skills are coming along, I hope you noticed we were able to skip past some parts with very little explanation. For example, you know very well how to create forms with text fields and pickers because weโve already covered that extensively, which means we can spend our time focusing on new stuff.
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.
- Use the userโs preferred currency, rather than always using US dollars.
- Modify the expense amounts in
ContentView
to contain some styling depending on their value โ expenses under $10 should have one style, expenses under $100 another, and expenses over $100 a third style. What those styles are depend on you. - For a bigger challenge, try splitting the expenses list into two sections: one for personal expenses, and one for business expenses. This is tricky for a few reasons, not least because it means being careful about how items are deleted!
iExpense: Wrap up