I have an Onboarding Window/Scene I want to appear on the first launch of the app, or when a use clicks a menu command.
Using an AppStorage with a boolean value would be perfect, but when I try to add an if in my SceneBuilder I get the following error: Closure containing control flow statement cannot be used with function builder 'SceneBuilder'.
How can this be done?
Using an AppStorage with a boolean value would be perfect, but when I try to add an if in my SceneBuilder I get the following error: Closure containing control flow statement cannot be used with function builder 'SceneBuilder'.
Code Block swift import SwiftUI @main struct MyApp: App { @AppStorage("tutorialVisible") var tutorialVisible: Bool = true var body: some Scene { MainScene() if tutorialVisible { TutorialScene() } } }
How can this be done?