DeepLink
@objc(GFYDeepLink)
public class DeepLink : NSObject
Represents a URL
that is assigned to a PageType
.
This is used in order to facilitate navigation to certain areas of your application.
See Configuring Granify for more information
-
A closure that accepts a set of parameters, and performs a navigation to the page of the relevant type. A different set of parameters will be passed for each page type, depending on what is most appropriate for that page type. Most page types will receive an empty set of parameters, but
.product
pages, for example, will receive two parameters:productId
andsku
. Note that the closure should NOT return aURL
- it is the responsibility of the closure to perform the navigation itself.Since
5.3.0Declaration
Swift
public typealias DeepLinkFactory = ([String : String]) -> Void
-
The page type you are wanting to deep link to
Since
2.0.0Declaration
Swift
@objc public let pageType: PageType
-
The URL used to deep link. eg
com.mycompany.MyApp://cart
Since
2.0.0Declaration
Swift
@objc public let link: URL?
-
A closure that performs the deep link. Accepts a collection of parameters, and allows the caller to decide exactly how the navigation should occur.
Since
5.3.0Declaration
Swift
@objc public let linkFactory: DeepLinkFactory?
-
Creates a
DeepLink
instance Must pass eitherlink
orlinkFactory
. If both are passed, the factory will take precedence.Declaration
Swift
@objc public init(pageType: PageType, link: URL? = nil, linkFactory: DeepLinkFactory? = nil)
Parameters
pageType
The page type you are wanting to deep link to
link
The URL used to deep link. eg
com.mycompany.MyApp://cart
linkFactory
A closure that performs the deep link. Accepts a collection of parameters, and allows the caller to decide exactly how the navigation should occur.
-
Retrives
String
representation ofDeepLink
Declaration
Swift
public override var description: String { get }