Files
ShoeGaze/Demo/ShoeGazeBuilderiOS/ShoeGazeBuilderiOSApp.swift
T
2026-06-22 15:40:23 -07:00

37 lines
1.2 KiB
Swift

// ShoeGazeBuilderiOSApp.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import SwiftUI
import LyrebirdShoeGazeUI
/// iOS entry point for the ShoeGaze Builder.
///
/// Holds the `ShoeGazeBuilderiOSAppModel` as `@State` so it is created once and owned for the
/// lifetime of the app. The audio engine is **not** started automatically — the user presses
/// Start in ``ShoeGazeBuilderView``. The engine is stopped when the view disappears.
///
/// ``ShoeGazeBuilderView`` manages its own scroll regions (palette + builder), so it is hosted
/// directly rather than wrapped in an outer `ScrollView`.
@main
struct ShoeGazeBuilderiOSApp: App {
@State private var model: ShoeGazeBuilderiOSAppModel = ShoeGazeBuilderiOSAppModel()
var body: some Scene {
WindowGroup {
NavigationStack {
ShoeGazeBuilderView(
shoeGaze: model.shoeGaze,
hardwareSampleRate: { model.hardwareSampleRate }
)
.navigationTitle("ShoeGaze Builder")
.navigationBarTitleDisplayMode(.inline)
}
.onDisappear { model.stop() }
}
}
}