TabbedView with Images under macOS

Greetings -


I have the following development environment:

10.15 Beta 3

XCode 11 Beta 3


I have the following target enviornment:

10.15 Beta 3


I have the painfully simple example for a basic two-tab window:

struct ContentView : View {

@State private var selection = 1


var body: some View {

TabbedView(selection: $selection) {

OrangeView().tabItem {

VStack {

Image("console")

Text("Console")

}

}.tag(1)

BlueView().tabItem {

VStack {

Image("compass-north")

Text("Compass")

}

}.tag(2)

}

}

}


struct OrangeView: View {

var body: some View {

ZStack {

Color.orange

Text("Orange")

.font(.title)

}

}

}


struct BlueView: View {

var body: some View {

ZStack {

Color.blue

Text("Blue")

.font(.title)

}

}

}


The tabs show just fine; however, I cannot get any images to show in the tabs. All I get is the text.


Does anyone have TabbedViews with Images working on macos?

Given the vertiable dearth of documentation on SwiftUI (yeah, a little sarcasm lol), and a bit of testing, I'm going to 'assume' that the tabItem modifier only accepts the first 'View' passed to it. Passing additional views of any type seems to have no results, even if they are built in a seperate struct and passed in as a single view. I didn't test using my own 'viewbuilder' however. Going to follow this to see what I can learn from others though.

TabbedView with Images under macOS
 
 
Q