Issue #689
func applicationDidFinishLaunching(_ aNotification: Notification) {
// extend to title bar
let contentView = ContentView()
// .padding(.top, 24) // can padding to give some space
.edgesIgnoringSafeArea(.top)
// specify fullSizeContentView
window = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 800, height: 600),
styleMask: [.titled, .closable, .miniaturizable, .texturedBackground, .resizable, .fullSizeContentView],
backing: .buffered,
defer: false
)
window.center()
window.setFrameAutosaveName("My App")
// window.title = ... // no title
// window.toolbar = NSToolbar() // use toolbar if wanted. This triggers .unifiedTitleAndToolbar styleMask
window.titlebarAppearsTransparent = true
window.titleVisibility = .hidden // hide title
window.backgroundColor = R.color.myBackgroundColor // set our preferred background color
window.contentView = NSHostingView(rootView: contentView)
window.makeKeyAndOrderFront(nil)
}
I have an issue where if I use HSplitView
, some Button are not clickable until I drag the split view handle. The workaround is to use HStack with a Divider
Updated at 2020-11-03 05:21:50