The code below doesn't show Text("Second View")
, because private var selection: UInt
.
struct TabMenu: View {
@State private var selection: UInt = 0
var body: some View {
TabView(selection: $selection){
Text("First View")
.font(.title)
.tabItem {
Image(systemName: "house")
Text("Main")
}
.tag(0)
Text("Second View")
.font(.title)
.tabItem {
Image(systemName: "gear")
Text("Preferences")
}
.tag(1)
}
}
}
In sources of TabView, I found this:
extension TabView where SelectionValue == Int {
@available(watchOS, unavailable)
public init(@ViewBuilder content: () -> Content)
}
How I can create a custom view where SelectionValue == Uint
?
where SelectionValue == Uint