Skip to content

Fix live OpenURL dependency on macOS - #464

Open
EhsanAzish80 wants to merge 1 commit into
pointfreeco:mainfrom
EhsanAzish80:fix/440-macos-open-url
Open

EhsanAzish80 wants to merge 1 commit into
pointfreeco:mainfrom
EhsanAzish80:fix/440-macos-open-url

Conversation

@EhsanAzish80

Copy link
Copy Markdown

On macOS, constructing EnvironmentValues().openURL outside a view hierarchy does not provide a handler, so the live @Dependency(\.openURL) returns false without opening the URL.

Use NSWorkspace.shared.open for the macOS live value while preserving the existing SwiftUI implementation on other platforms. Add regression coverage for URL forwarding and the workspace result.

Fixes #440.

Tests:

  • swift test --scratch-path /private/tmp/swift-dependencies-440-build
  • iOS Simulator Dependencies scheme build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenURL doesn't work on macOS

1 participant