iOS Swift - Navigation
Which of the following code snippets correctly creates a
TabView with two tabs labeled "Dashboard" and "Settings" in SwiftUI?TabView with two tabs labeled "Dashboard" and "Settings" in SwiftUI?.tabItem modifier requires a label with text and optionally an image.Label with text and system image inside tabItem.tabItem to the whole TabView, which is invalid. TabView {
Text("Dashboard").tabItem(Label("Dashboard"))
Text("Settings").tabItem(Label("Settings"))
} misses system images. TabView {
Text("Dashboard").tabItem { Image(systemName: "speedometer") }
Text("Settings").tabItem { Image(systemName: "gear") }
} uses only images without labels.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions