Created
September 16, 2022 10:35
-
-
Save vikingosegundo/c73af6eaf13c9cc43d81ad97d9242732 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public struct ContentView: View { | |
public init(viewState: ViewState, rootHandler: @escaping (Message) -> ()) { | |
self.viewState = viewState | |
self.rootHandler = rootHandler | |
} | |
public var body: some View { | |
TabView(selection:$tab) { | |
Dashboard(rootHandler).tabItem { Label(name(for:0), systemImage:imageName(for:0)) }.tag(0) | |
Lights (rootHandler).tabItem { Label(name(for:1), systemImage:imageName(for:1)) }.tag(1) | |
Rooms (rootHandler).tabItem { Label(name(for:2), systemImage:imageName(for:2)) }.tag(2) | |
Shop (rootHandler).tabItem { Label(name(for:3), systemImage:imageName(for:3)) }.tag(3) | |
Settings (rootHandler).tabItem { Label(name(for:4), systemImage:imageName(for:4)) }.tag(4) | |
} | |
.environmentObject(viewState) | |
} | |
@ObservedObject | |
private var viewState : ViewState | |
private let rootHandler: (Message) -> () | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment