wip
This commit is contained in:
parent
7aa5812c3b
commit
93c5c959ff
|
@ -12,12 +12,14 @@ struct ContentView: View {
|
||||||
ScrollViewShowcase()
|
ScrollViewShowcase()
|
||||||
.tabItem { Text("ScrollView") }
|
.tabItem { Text("ScrollView") }
|
||||||
.tag(1)
|
.tag(1)
|
||||||
|
#if !os(macOS)
|
||||||
NavigationShowcase()
|
NavigationShowcase()
|
||||||
.tabItem { Text("Navigation") }
|
.tabItem { Text("Navigation") }
|
||||||
.tag(2)
|
.tag(2)
|
||||||
ViewControllerShowcase()
|
ViewControllerShowcase()
|
||||||
.tabItem { Text("ViewController") }
|
.tabItem { Text("ViewController") }
|
||||||
.tag(3)
|
.tag(3)
|
||||||
|
#endif
|
||||||
SimpleElementsShowcase()
|
SimpleElementsShowcase()
|
||||||
.tabItem { Text("Simple elements") }
|
.tabItem { Text("Simple elements") }
|
||||||
.tag(4)
|
.tag(4)
|
||||||
|
@ -160,37 +162,37 @@ struct ScrollViewShowcase: View {
|
||||||
struct NavigationShowcase: View {
|
struct NavigationShowcase: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
Text("Customized")
|
Text("Content")
|
||||||
// .modifier {
|
.modifier {
|
||||||
// if #available(iOS 15, tvOS 15, *) {
|
if #available(iOS 15, tvOS 15, macOS 12, *) {
|
||||||
// $0.searchable(text: .constant(""))
|
$0.searchable(text: .constant(""))
|
||||||
// } else {
|
} else {
|
||||||
// $0
|
$0
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// .modifier {
|
#if os(iOS)
|
||||||
//// #if os(iOS)
|
.navigationBarTitle(Text("Customized"), displayMode: .inline)
|
||||||
// if #available(iOS 15, *) {
|
#elseif os(macOS)
|
||||||
// $0.introspectSearchController { searchController in
|
.navigationTitle(Text("Navigation"))
|
||||||
// searchController.searchBar.backgroundColor = .purple
|
#endif
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// $0
|
|
||||||
// }
|
|
||||||
// #else
|
|
||||||
// $0
|
|
||||||
// #endif
|
|
||||||
// }
|
|
||||||
// #if !os(tvOS)
|
|
||||||
// .navigationBarTitle(Text("Customized"), displayMode: .inline)
|
|
||||||
// #endif
|
|
||||||
// .introspectNavigationController { navigationController in
|
|
||||||
// navigationController.navigationBar.backgroundColor = .red
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
// .introspectSplitViewController { splitViewController in
|
#if os(iOS) || os(tvOS)
|
||||||
// splitViewController.preferredDisplayMode = .oneOverSecondary
|
.introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16), .tvOS(.v13, .v14, .v15, .v16)) { navigationController in
|
||||||
// }
|
navigationController.navigationBar.backgroundColor = .cyan
|
||||||
|
}
|
||||||
|
.introspect(.navigationView(style: .columns), on: .iOS(.v13, .v14, .v15, .v16)) { splitViewController in
|
||||||
|
splitViewController.preferredDisplayMode = .oneOverSecondary
|
||||||
|
}
|
||||||
|
.introspect(.navigationView(style: .columns), on: .tvOS(.v13, .v14, .v15, .v16)) { navigationController in
|
||||||
|
navigationController.navigationBar.backgroundColor = .cyan
|
||||||
|
}
|
||||||
|
.introspect(.searchField, on: .iOS(.v15, .v16), .tvOS(.v15, .v16)) { searchField in
|
||||||
|
searchField.backgroundColor = .red
|
||||||
|
#if os(iOS)
|
||||||
|
searchField.searchTextField.backgroundColor = .purple
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,9 +202,11 @@ struct ViewControllerShowcase: View {
|
||||||
VStack {
|
VStack {
|
||||||
Text("Customized")
|
Text("Customized")
|
||||||
}
|
}
|
||||||
// .introspectViewController { viewController in
|
#if os(iOS) || os(tvOS)
|
||||||
// viewController.navigationItem.title = "Customized"
|
.introspect(.view, on: .iOS(.v13, .v14, .v15, .v16), .tvOS(.v13, .v14, .v15, .v16)) { viewController in
|
||||||
// }
|
viewController.view.backgroundColor = .cyan
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue