One Quickie


Default to a particular tab bar tab (SwiftUI->Random)
enum Tab: Hashable {
    case simplePlan
    case complicatedPlan
    case multiPlan

    var id: Self { self }
}

struct ContentView: View {
    @State private var tab = Tab.complicatedPlan

    var body: some View {
        TabView(selection: $tab) {
            SimplePlan(captureModel: SimpleCaptureModel.shared)
              .tabItem {
                  Label("Simple Plan", systemImage: "house")
              }
              .tag(Tab.simplePlan)
            CompliPlan(captureModel: CompliCaptureModel.shared)
              .tabItem {
                  Label("Complicated Plan", systemImage: "house.circle.fill")
              }
              .tag(Tab.complicatedPlan)
            MultiPlan()
              .tabItem {
                  Label("Multi Plan", systemImage: "house.lodge")
              }
              .tag(Tab.multiPlan)
        }
    }
}



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com