WindowReader

2.0.0

📱 Access UIWindow/NSWindow in SwiftUI
divadretlaw/WindowReader

What's New

2.0.0

2024-02-28T09:42:00Z
  • Support visionOS

Full Changelog: 1.3.0...2.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: Sat Oct 19 2024 22:48:10 GMT-0900 (Hawaii-Aleutian Daylight Time)