Antom, leading provider of tailored payment solutionsAntom, leading provider of tailored payment solutions

Customize loading view

The default loading view of Griver is shown below. To customize your loading view, create your own class that conforms to GRVLoadingViewDelegate protocol.

image.png

Sample code

Here is the demo implementation used by GriverDemo project.

copy
let config = IAPConnectInitConfig()
let extensionDelegate = GRVExtensionDelegate()
extensionDelegate.uiProvider.loadingViewDelegate = DemoLoadingViewDelegate()
config.riverExtensionDelegate = extensionDelegate

Sample

image.png

The picture above shows the demo implementation. For the full demo code, refer to GriverDemo project.

Detail

To create your own loading view implementation, use these two methods to implement from GRVLoadingViewDelegate. See below for a detailed explanation.

copy
/**
 Griver uses this delegate to customize UI for loading view.
 This loading normally occurs when "showLoading" is set to @(YES) in startup parameters for opening a container,
 or when the JSAPI "showLoading" is called from front end.
 */

@protocol GRVLoadingViewDelegate <NSObject>

/// Inform the delegate to show an loading view in a container view. Please don't present a screen level view that disables all users interactions,
/// only add your own view as a subview to the container view.
/// @param view The container view.
/// @param text The text to be shown.
- (void)showInView:(UIView *)view withText:(NSString *)text;

/// Inform the delegate to dismiss the loading view from the container view.
/// @param view The container view.
- (void)dismissForView:(UIView *)view;

@end