@@ -20,44 +20,43 @@ struct AppView: View {
2020}
2121
2222struct ContentView : View {
23- @State var selection = 0
24-
2523 var body : some View {
26- TabView ( selection : $selection ) {
24+ TabView {
2725 ListShowcase ( )
28- . tabItem { Text ( " List " ) }
29- . tag ( 0 )
26+ . tabItem { Label ( " List " , systemImage: " 1.circle " ) }
3027 ScrollViewShowcase ( )
31- . tabItem { Text ( " ScrollView " ) }
32- . tag ( 1 )
28+ . tabItem { Label ( " ScrollView " , systemImage: " 2.circle " ) }
3329 #if !os(macOS)
3430 NavigationShowcase ( )
35- . tabItem { Text ( " Navigation " ) }
36- . tag ( 2 )
31+ . tabItem { Label ( " Navigation " , systemImage: " 3.circle " ) }
3732 PresentationShowcase ( )
38- . tabItem { Text ( " Presentation " ) }
39- . tag ( 3 )
33+ . tabItem { Label ( " Presentation " , systemImage: " 4.circle " ) }
4034 #endif
4135 ControlsShowcase ( )
42- . tabItem { Text ( " Controls " ) }
43- . tag ( 4 )
36+ . tabItem { Label ( " Controls " , systemImage: " 5.circle " ) }
4437 UIViewRepresentableShowcase ( )
45- . tabItem { Text ( " UIViewRepresentables " ) }
46- . tag ( 5 )
38+ . tabItem { Label ( " UIViewRepresentables " , systemImage: " 6.circle " ) }
4739 }
4840 #if os(iOS) || os(tvOS)
4941 . introspect( . tabView, on: . iOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) , . tvOS( . v13, . v14, . v15, . v16, . v17, . v18, . v26) ) { tabBarController in
50- tabBarController. tabBar. layer. backgroundColor = UIColor . green. cgColor
42+ if #available( iOS 26 , macOS 26 , tvOS 26 , * ) {
43+ tabBarController. tabBar. backgroundColor = . green
44+ } else {
45+ let appearance = UITabBarAppearance ( )
46+ appearance. configureWithOpaqueBackground ( )
47+ appearance. backgroundColor = . green
48+ tabBarController. tabBar. standardAppearance = appearance
49+ tabBarController. tabBar. scrollEdgeAppearance = appearance
50+ }
5151 }
5252 #elseif os(macOS)
5353 . introspect( . tabView, on: . macOS( . v10_15, . v11, . v12, . v13, . v14) ) { splitView in
5454 splitView. subviews. first? . layer? . backgroundColor = NSColor . green. cgColor
5555 }
5656 #endif
57- . preferredColorScheme( . light)
5857 }
5958}
6059
6160#Preview {
62- ContentView ( )
61+ AppView ( ) . preferredColorScheme ( . light )
6362}
0 commit comments