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
.productpages, for example, will receive two parameters:productIdandsku. 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://cartSince
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
DeepLinkinstance Must pass eitherlinkorlinkFactory. If both are passed, the factory will take precedence.Declaration
Swift
@objc public init(pageType: PageType, link: URL? = nil, linkFactory: DeepLinkFactory? = nil)Parameters
pageTypeThe page type you are wanting to deep link to
linkThe URL used to deep link. eg
com.mycompany.MyApp://cartlinkFactoryA closure that performs the deep link. Accepts a collection of parameters, and allows the caller to decide exactly how the navigation should occur.
-
Retrives
Stringrepresentation ofDeepLinkDeclaration
Swift
public override var description: String { get }
DeepLink Class Reference