Standings
We will work on one more module together before you get to work on the next challenge. Before we jump into StandingsModuleView
, we need to update StandingItem
.
StandingItem
We have a few things we need to add to StandingItem
:
- First, we will add the following
Team
variable:var item: Team
- Next, we'll update the team name with the following code:
Text(item.shortName)
- Now, add the following for the team's record:
Text(item.record())
- We need to update the winning percentage with the following updates:
Text(item.winPct)
- Let's now update the games behind:
Text(item.gamesBehind)
- Finally, make sure you update the preview with the following:
static var previews: some View { StandingItem(item: Team.default).previewLayout(. fixed(width: 600, height: 25)) }
With that, we've made all the changes we need to StandingItem
. Let's wrap up our dashboard by making a few changes to StandingsModuleView...