I’m using AVAudioEngine of AVFoundation with SwiftUI in Swift Playground and using MVVM as Architecture. But if I separate my structs in files, I receive two errors: Execution was interrupted, reason: signal SIGABRT. and Cannot find file in scope. The only way that all works is using them in the same file. Here is the […]
- Tags alignment: .center) NavigationView { VStack { NavigationLink("Start", at: nil, completionHandler: nil) } public func playSound() { player.isPlaying ? player.pause() : player.play() } } Trying to ca, destination: MusicCreatorView()) } } } } } PlaygroundPage.current.setLiveView(StartView()) // error:, format: format) engine.prepare() do { try engine.start() } catch { print(error.localized, height = 400), I receive two errors: Execution was interrupted, I'm using AVAudioEngine of AVFoundation with SwiftUI in Swift Playground and using MVVM as Architecture. But if I separate my structs in file, just move SIGABRT error from PlaygroundPage.current.setLineView() to where it is called) but can't be found by MusicCreatorView. import Foun, reason: signal SIGABRT. and Cannot find file in scope. The only way that all works is using them in the same file. Here is the playground ba, reason: signal SIGABRT. AudioEngine can be found by StartView (if called at StartView, to: engine.mainMixerNode, where I call MusicCreatorView. import SwiftUI import PlaygroundSupport public struct StartView: View { public var body: some View {, withExtension: "mp3") guard let format = audioFormat else { return } engine.attach(player) engine.connect(player