WindowReader

3.0.0

📱 Access UIWindow/NSWindow in SwiftUI
divadretlaw/WindowReader

What's New

3.0.0

2025-02-01T10:03:49Z

Full Changelog: 2.0.1...3.0.0

WindowReader

Access the current UIWindow or NSWindow from any SwiftUI view.

Usage

Read the current UIWindow or NSWindow with WindowReader

@main
struct MyView: View {
    var body: some Scene {
        WindowReader { window in
            ...
        }
    }
}

On child views the UIWindow or NSWindow will be available in the Environment

Environment

@Environment(\.window) var window

License

See LICENSE

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Tue May 13 2025 09:36:58 GMT-0900 (Hawaii-Aleutian Daylight Time)