Closed mromanbanks closed 1 week ago
Hi! What a coincidence, I actually came across the same issue the other day. It looks like SwiftUI is unable to tell if an application is rooted in SwiftUI from NSHostingView
s we create ourselves. I suppose it technically does make sense since NSHostingView
creates a completely isolated environment, but it is a bit annoying in this case
Unfortunately, my workaround for now has been to just create my own NSWindow
and make my own ViewModifier
to interact with it (or just keep a reference in AppDelegate
).
Makes sense. Thank you for the explanation!
Unfortunately, my workaround for now has been to just create my own
NSWindow
and make my ownViewModifier
to interact with it (or just keep a reference inAppDelegate
).
Hi @lfroms! Would you mind sharing an example of your workaround? I'm stuck on the same issue. Very appreciative of this little tool 👏🏻!
Hi folks, sorry for the delay. A quick Google search turned up this guide which is similar to how I've been doing things. Can use an NSWindow
subclass instead of NSPanel
if you want a typical title bar setup, etc.
Hey guys! I'm trying to open new window from the app and getting
Use of OpenWindowAction requires the SwiftUI App Lifecycle.
error. Could you please give a hint how to correctly open windows with SwiftUI and this library?