[Solved] Where to place code for audio playback in a SwiftUI app [closed]
Correct, the View shouldn’t take care of data. And SwiftUI enforces this logic. You could create a Player class which takes care of playing the audio. And add it as an EnvironmentObject, so you can control it with your button in the View. You can then do sweet things like binding your play button to … Read more