macOS, iOS
[SwiftUI] ForEach + enumerated
SweetDev
2021. 5. 24. 12:39
ForEach(Array(viewModel.cards.enumerated()), id: \.offset) { index, card in
Circle()
.background(selectedItem == index ? Color.red : Color.blue)
.frame(width: 5, height: 5)
}