mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
32 lines
779 B
Swift
32 lines
779 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@StateObject private var navigationState = NavigationState()
|
|
|
|
#if os(iOS)
|
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
|
#endif
|
|
|
|
var body: some View {
|
|
Section {
|
|
#if os(iOS)
|
|
if horizontalSizeClass == .compact {
|
|
AppTabNavigation()
|
|
} else {
|
|
AppSidebarNavigation()
|
|
}
|
|
#elseif os(macOS)
|
|
AppSidebarNavigation()
|
|
#elseif os(tvOS)
|
|
TVNavigationView()
|
|
#endif
|
|
}.environmentObject(navigationState)
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|