Skip to main content

Day 38

About 2 minSwiftcrashcoursepaul-hudsonswiftswiftuihacking-with-swiftxcodeappstore

Day 38 ๊ด€๋ จ


100 Days of SwiftUI - Day 38

Project 7, part 3

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
100 Days of SwiftUI - Day 38 - 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.open in new window

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.

  1. Use the userโ€™s preferred currency, rather than always using US dollars.
  2. 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.
  3. 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!

์ด์ฐฌํฌ (MarkiiimarK)
Never Stop Learning.