Understanding the home view logic
Let's look at our first screen now, the home view. Let's take a look at how we will break down the home view into smaller views:
If you look at the preceding screen, you will notice that we have a header at the top, followed by our card view, representing the account we selected. Next, we have our submenu, which contains quick links to other services. Finally, we have basic account information, and this information is based on whether it's a credit card or debit card. Let's get started by opening the starter project.
Home header
You can find the starter project for this chapter in the Chapter06
folder called starter
. To get started, open HomeHeaderView
. Update the variable previews inside of HomeHeaderView_Previews
with the following:
HomeHeaderView() .previewLayout(.fixed(width: 600, height: 80))
Now, inside of this file, add the following inside of...