In SwiftUI for macOS, how can I hide the tab bar when using TabView
? I would like to provide my own tab bar implementation.
In AppKit's NSTabViewController
, we can do the following:
let tabViewController = NSTabViewController()
tabViewController.tabStyle = .unspecified
I've come across various posts that suggest using the .toolbar
modifier, but none appear to work on macOS (or at least I haven't found the right implementation).
struct ContentView: View {
var body: some View {
TabView {
// ... content
} <- which view modifier hides the tab bar?
}
}
Latest macOS, Latest Xcode