@@ -27,19 +27,19 @@ struct ContentView: View {
2727 ListShowcase ( )
2828 . tabItem { Text ( " List " ) }
2929 . tag ( 0 )
30+ ScrollViewShowcase ( )
31+ . tabItem { Text ( " ScrollView " ) }
32+ . tag ( 1 )
3033 #if !os(macOS)
3134 NavigationShowcase ( )
3235 . tabItem { Text ( " Navigation " ) }
33- . tag ( 1 )
36+ . tag ( 2 )
3437 PresentationShowcase ( )
3538 . tabItem { Text ( " Presentation " ) }
36- . tag ( 2 )
37- #endif
38- ScrollViewShowcase ( )
39- . tabItem { Text ( " ScrollView " ) }
4039 . tag ( 3 )
41- SimpleElementsShowcase ( )
42- . tabItem { Text ( " Simple elements " ) }
40+ #endif
41+ ControlsShowcase ( )
42+ . tabItem { Text ( " Controls " ) }
4343 . tag ( 4 )
4444 UIViewRepresentableShowcase ( )
4545 . tabItem { Text ( " UIViewRepresentables " ) }
@@ -58,56 +58,6 @@ struct ContentView: View {
5858 }
5959}
6060
61- struct NavigationShowcase : View {
62- var body : some View {
63- NavigationView {
64- Text ( " Content " )
65- . modifier {
66- if #available( iOS 15 , tvOS 15 , macOS 12 , * ) {
67- $0. searchable ( text: . constant( " " ) )
68- } else {
69- $0
70- }
71- }
72- #if os(iOS) || os(visionOS)
73- . navigationBarTitle( Text ( " Customized " ) , displayMode: . inline)
74- #elseif os(macOS)
75- . navigationTitle( Text ( " Navigation " ) )
76- #endif
77- }
78- #if os(iOS) || os(tvOS) || os(visionOS)
79- . introspect(
80- . navigationView( style: . stack) ,
81- on: . iOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) , . tvOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) , . visionOS( . v1, . v2, . v26)
82- ) { navigationController in
83- navigationController. navigationBar. backgroundColor = . cyan
84- }
85- . introspect (
86- . navigationView( style: . columns) ,
87- on: . iOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) , . visionOS( . v1, . v2, . v26)
88- ) { splitViewController in
89- #if os(visionOS)
90- splitViewController. preferredDisplayMode = . oneBesideSecondary
91- #else
92- splitViewController. preferredDisplayMode = . oneOverSecondary
93- #endif
94- }
95- . introspect ( . navigationView( style: . columns) , on: . tvOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) ) { navigationController in
96- navigationController. navigationBar. backgroundColor = . cyan
97- }
98- . introspect (
99- . searchField,
100- on: . iOS( . v15, . v16, . v17, . v18, . v26) , . tvOS( . v15, . v16, . v17, . v18, . v26) , . visionOS( . v1, . v2, . v26)
101- ) { searchBar in
102- searchBar. backgroundColor = . red
103- #if os(iOS)
104- searchBar. searchTextField. backgroundColor = . purple
105- #endif
106- }
107- #endif
108- }
109- }
110-
11161#if !os(macOS)
11262struct PresentationShowcase : View {
11363 @State var isSheetPresented = false
@@ -231,7 +181,7 @@ struct UIViewRepresentableShowcase: View {
231181 }
232182}
233183
234- struct SimpleElementsShowcase : View {
184+ struct ControlsShowcase : View {
235185
236186 @State private var textFieldValue = " "
237187 @State private var toggleValue = false
0 commit comments