Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios]Fix compile error when conforming UIApplication to Launcher due …
…to MainActor annotation (#7100) iOS 18 Beta 3 added `@MainActor @Sendable` for openURL's completion handler: ``` @available(iOS 10.0, *) open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: (@mainactor @sendable (Bool) -> Void)? = nil) ``` The addition of `@MainActor` is the one that caused the compile error. It was not there for Beta 1. This PR we simply use a `DefaultLauncher` wrapper. As expected, passing in a **non-isolated closure** to a function that expects a **main-actor isolated closure** is fine, since non-isolated closure can be called in any isolation context; plus the minimal concurrency checking also silences the Sendable warning. But we should check again in newer betas if we can revert this change. Because this compile error forces some libraries to update for swift concurrency, which seems to be against the whole idea of having 3 different levels of concurrency checking. So I suspect that Apple is still hashing things out and may change it back (either by removing `@MainActor` from signature, or compiler change to allow this conformance under minimal checking) *List which issues are fixed by this PR. You must list at least one issue.* Fixes flutter/flutter#151467
- Loading branch information