Hi is there a way to change the window level with SwiftUI so I can make a floating window for my mac app? I am using the SwiftUI life cycle
Asked
Active
Viewed 1,335 times
1 Answers
6
You can access your windows with NSApplication.shared.windows
and set the level
for each one.
For instance:
Button("Float windows") {
for window in NSApplication.shared.windows {
window.level = .floating
}
}

Alexander Sandberg
- 1,265
- 11
- 19