Skip to content

Deeplink

ohitsdaniel edited this page Apr 29, 2021 · 5 revisions

Deeplink

First class representation of a deeplink based on URLs

public struct Deeplink: Hashable 

Inheritance

Hashable

Initializers

init?(url:matching:)

Initialise a deeplink from a URL, matching the passed Scheme

public init?(url: URL, matching scheme: String) 

Typically used to parse deeplinks from URL scheme triggers

Example

// scheme://name?flag&value=123
let url = URL(string: "scheme://name?flag&value=123")!

let deeplink = Deeplink(
  url: url,
  matching: "scheme"
)

deeplink.components == [
  DeeplinkComponent(
    name: "name",
    arguments: [
      "flag": .flag,
      "value": "123"
    ]
  )
] // True

Properties

components

public let components: [DeeplinkComponent]
Clone this wiki locally