-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from hotwired/turbo-navigator-handle-open-ext…
…ernalURL
- Loading branch information
Showing
5 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Source/Turbo Navigator/Helpers/ExternalURLNavigationAction.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Foundation | ||
|
||
/// When TurboNavigator encounters an external URL, its delegate may handle it with any of these actions. | ||
public enum ExternalURLNavigationAction { | ||
/// Attempts to open via an embedded `SafariViewController` so the user stays in-app. | ||
/// Silently fails if you pass a URL that's not `http` or `https`. | ||
case openViaSafariController | ||
|
||
/// Attempts to open via `openURL(_:options:completionHandler)`. | ||
/// This is useful if the external URL is a deeplink. | ||
case openViaSystem | ||
|
||
/// Will do nothing with the external URL. | ||
case reject | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters