SnapscreenSnapViewControllerDelegate
@protocol SnapscreenSnapViewControllerDelegate
Provides callback from the SnapscreenSnapViewController during the snapping process.
-
Snapping did occur and did find at least one result. You should dismiss the UI in this case and continue in your application’s flow that uses the snap result.
Declaration
Objective-C
- (void)snapscreenDidSnapResult:(SnapscreenSearchResult *_Nonnull)snapResult selectedResultEntry: (SnapscreenSearchResultEntry *_Nonnull)selectedResultEntry;
Swift
func snapscreenDidSnapResult(_ snapResult: SnapscreenSearchResult, selectedResultEntry: SnapscreenSearchResultEntry)
Parameters
snapResult
The result of the snap. Contains at least one result entry.
selectedResultEntry
The selected entry of the snap.
-
Snapping did occur but did not yield any results. The SnapscreenSnapViewController presents an inline error in the UI in that case and you may decide to keep on snapping or dismiss the view controller.
Declaration
Objective-C
- (void)snapscreenSnapViewControllerDidSnapNoResults: (SnapscreenSnapViewController *_Nonnull)snapViewController;
Swift
func snapscreenSnapViewControllerDidSnapNoResults(_ snapViewController: SnapscreenSnapViewController)
Parameters
snapViewController
The view controller for snapping
-
Snapping did fail with an error and is most likely to not succeed subsequently as well. You should dismiss the SnapscreenSnapViewController and present an error to the user.
Declaration
Objective-C
- (void)snapscreenSnapViewController: (SnapscreenSnapViewController *_Nonnull)snapViewController didFailWithError:(id)error;
Swift
func snapscreenSnapViewController(_ snapViewController: SnapscreenSnapViewController, didFailWithError error: Any!)
Parameters
snapViewController
The view controller for snapping
error
The error that occured. Might be null or not contain relevant information.
-
The user did cancel snapping. You should dismiss the SnapscreenSnapViewController.
Declaration
Objective-C
- (void)snapscreenSnapViewControllerDidCancel: (SnapscreenSnapViewController *_Nonnull)snapViewController;
Swift
func snapscreenSnapViewControllerDidCancel(_ snapViewController: SnapscreenSnapViewController)
Parameters
snapViewController
The view controller for snapping