Search code examples
swiftmacosswiftuiswiftui-form

Changing the shape of the window from rectangle to other shapes in macOS, It is possible?


Now I'm learning on SwiftUI.

What I want to do is make window as Hexagon or circle. For putting this app with opacity on edge of the display beautifully.

But the only thing I can do is making it as square. Like many apps have been.

This is possible?

Then what should I do? Please give me some advices.

Sorry for my poor English. Thank you. Have a nice day!


Solution

  • Yes, you can create a borderless NSWindow and host a view with NSHostingView.