BookingItemSearchDelegate
public protocol BookingItemSearchDelegate : AnyObject
Notified of catalog search results
-
Called when the
BookingItems
were searched successfully- result:
BookingItemSearchResult
filtered by search query - identifier: A
Hashable
identifying the request that was made. This will be the same identifier you passed to the search catalog call
Declaration
Swift
func bookingItemSearchDidSucceedWith(_ result: BookingItemSearchResult, identifier: AnyHashable?)
- result:
-
Called when there was an error searching the catalog
- error: The
Error
representing the reason for failure. No specific errors to look for here. Best course of action is to just display a generic error message. - identifier: A
Hashable
identifying the request that was made. This will be the same identifier you passed to the search catalog call
Declaration
Swift
func bookingItemSearchDidFailWith(_ error: Error, identifier: AnyHashable?)
- error: The
-
previousResult()
Default implementationCalled before supplying the searched items. This is your opportunity to return any previous (paged) results you had so the SDK can merge them for you. Default implementation of this method returns nil.
Default Implementation
Declaration
Swift
func previousResult() -> BookingItemSearchResult?
Return Value
Any previous
CatalogItemSearchResult
that corresponds to the sameCatalogItemSearchQuery
. nil if none -
bookingItemSearchDidReceive(_:
Default implementationidentifier: ) Called when the results have been fetched and merged. This method is called on a background thread and gives you the opportunity to substitute any buffering or volitile variables you may be holding. Default implementation of this method is a no-op.
- result: The fetched and merged
CatalogItemSearchResult
- identifier: A
Hashable
identifying the request that was made. This will be same identifier you passed to fetch orders call.
Default Implementation
Declaration
Swift
func bookingItemSearchDidReceive(_ result: BookingItemSearchResult, identifier: AnyHashable?)
- result: The fetched and merged