Catalog

Use this method to fetch a personalized catalog of purchasable items

let query = CatalogQuery()
Traveler.fetchCatalog(query: query) { (catalog, error) in 

}

Alternatively you can use the delegate pattern

Traveler.fetchCatalog(query: query, delegate: self)
extension MyViewController: CatalogFetchDelegate {
    func catalogFetchDidSucceedWith(_ result: Catalog) {
    
    }
    
    func catalogFetchDidFailWith(_ error: Error) {
    
    }
}

The UI SDK ships with a view controller which you can use (and/or subclass) to display the catalog. If you wish you can also use them via storyboards, just remember to pass along the Catalog instance.

let catalogResultVC = CatalogResultViewController()
catalogResultVC.catalog = catalog
present(catalogResultVC, animated: true)

Should you require further customization, the UI SDK ships with a CatalogView that provides the basics of displaying two dimensional data.

Last updated