Last active
August 8, 2024 00:42
-
-
Save StewartLynch/af10b49dbaafc69f3828e187bd346de5 to your computer and use it in GitHub Desktop.
App Crashes when return to Home Screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var selection: Int = 1 | |
@AppStorage("MyAppTabViewCustomization") private var customization: TabViewCustomization | |
var body: some View { | |
TabView(selection: $selection) { | |
TabSection("Vacations") { | |
Tab("Planned", systemImage: "airplane", value: 1) { | |
Text("Planned Vacations") | |
} | |
.customizationID("plannedVacation") | |
Tab("Taken", systemImage: "checklist", value: 2) { | |
Text("Taken Vacations") | |
} | |
.customizationID("takenVacation") | |
} | |
.customizationID("VacationSection") | |
} | |
.tabViewStyle(.sidebarAdaptable) | |
.tabViewCustomization($customization) | |
} | |
} | |
#Preview { | |
ContentView() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment