Skip to content

ios: Check we're on the main thread before opening URL #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Mar 9, 2025

-[UIApplication openURL:options:completionHandler:] is not safe to use from a thread that is not the main thread, since UIApplication is marked as NS_SWIFT_UI_ACTOR in the header, and the method is not marked with NS_SWIFT_NONISOLATED (unlike e.g. canOpenURL:, which is also explicitly documented to be usable from off the main thread).

See also discussion in #95, this check is present in objc2-ui-kit.

Builds upon #97 to avoid a merge conflict.

madsmtm added 2 commits March 9, 2025 20:15
`-[UIApplication openURL:options:completionHandler:]` is not safe to use
from a thread that is not the main thread, since `UIApplication` is
marked as `NS_SWIFT_UI_ACTOR` in the header, and the method is not
marked with `NS_SWIFT_NONISOLATED` (unlike e.g. `canOpenURL:`).
@amodm
Copy link
Owner

amodm commented Mar 10, 2025

Using #95 over this.

@amodm amodm closed this Mar 10, 2025
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.

2 participants