How to hide the title bar in a SwiftUI macOS app?

1 · Ram · Jan. 26, 2024, 4:40 p.m.
Let’s say you have a view named ContentView and your main App file looks like this: @main struct ExampleApp: App { var body: some Scene { WindowGroup { ContentView() } } } To hide the title bar in the main window, you can simply add this line .windowStyle(.hiddenTitleBar) to the WindowGroup like this: @main struct ForegroundApp: App { var body: some Scene { WindowGroup { ContentView() } .windowStyle(.hiddenTitleBar) ...