Skip to content

Instantly share code, notes, and snippets.

@Rashidium
Created March 31, 2021 18:28
Show Gist options
  • Save Rashidium/18aaea039ebf99868f3303e1d131049b to your computer and use it in GitHub Desktop.
Save Rashidium/18aaea039ebf99868f3303e1d131049b to your computer and use it in GitHub Desktop.
/// AppLinkable's for deeplink navigation.
public protocol AppLinkable {
/// Returns AppLinkable if url is satisfied
/// - Parameter url: URL of deeplink
func getLinkable(_ url: URL) -> Self?
/// Returns OneLinkable if url is satisfied.
/// - Parameter payload: Push notification payload of the deeplink.
func getLinkable(payload: [AnyHashable: Any]) -> Self?
/// Routes deeplink with `AppLinkRoutable` conformance.
/// - Parameter router: Action to be taken when link is ready.
func link(from router: AppLinkRoutable)
}
public extension AppLinkable {
func getLinkable(payload: [AnyHashable: Any]) -> Self? {
return nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment