Skip to content

Instantly share code, notes, and snippets.

@mhdhejazi
Last active April 27, 2020 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhdhejazi/ab142612920a7e573c8bed6f04c6faad to your computer and use it in GitHub Desktop.
Save mhdhejazi/ab142612920a7e573c8bed6f04c6faad to your computer and use it in GitHub Desktop.
Get the NSWindow from UIWindow in a Mac Catalyst app with the help of Dynamic (https://github.com/mhdhejazi/Dynamic). Credit: @steipete
extension UIWindow {
var nsWindow: NSObject? {
Dynamic.NSApplication.sharedApplication.delegate.hostWindowForUIWindow(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment