Created
June 28, 2020 13:29
-
-
Save Kilo-Loco/935c20ab06cf212e3f451635c5b84c1c to your computer and use it in GitHub Desktop.
Show faceoff teams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TeamFaceOffView: View { | |
let teams = Animal.all | |
var body: some View { | |
List { | |
let indecies = Array(0 ..< teams.count) | |
.filter { $0.isMultiple(of: 2) } | |
ForEach(indecies, id: \.self) { index in | |
let leftTeam = teams[index] | |
let rightTeam = teams[index + 1] | |
HStack { | |
Text(leftTeam.name) | |
Spacer() | |
Text(leftTeam.icon) | |
Text("9:00") | |
Text(rightTeam.icon) | |
Spacer() | |
Text(rightTeam.name) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment