struct SoundsView: View {
@EnvironmentObject var theme: ThemeManager
//var soundManager = SoundManager()
@StateObject var soundViewVM = SoundViewViewModel()
var body: some View {
List {
ForEach(soundViewVM.sounds) { sound in
Button {
//soundManager.playSound(name: sound.name)
soundViewVM.toggleItems(soundItem: sound)
} label: {
HStack(alignment: .center, spacing: 2) {
Text(sound.displayName)
Spacer()
sound.isActive ? Circle().frame(width: 10).foregroundColor(theme.lightColor) : nil
}
}
}
}
.listStyle(.elliptical)
.navigationTitle {
HStack {
Text("Sounds")
Spacer()
}
}
}
}
```
Became Hot Network Question