Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 910 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 910 Bytes

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