onOpenURL(prefersInApp:)
Sets an OpenURLAction that prefers opening URL with an in-app browser. The handler closure takes a URL as input, and returns a OpenURLAction.Result that indicates the outcome of the action.
Declaration
@MainActor @preconcurrency func onOpenURL(prefersInApp: Bool) -> some View
Parameters
- prefersInApp:
A boolean value that specifies whether to prefer to open the URL with an in-app browser or not.
Discussion
It’s equivalent to calling .onOpenURL(_:)
.onOpenURL { _ in
.systemAction(prefersInApp: prefersInApp)
}