VOHtmlGameViewController

@interface VOHtmlGameViewController
    : UIViewController <VOGameViewControllerProtocol>

VOHtmlGameViewController presents a fullscreen SKWebView to enable users to play games that support VOHtmlGameData.

  • The object responsible for handling delegate callbacks from the VOHtmlGameViewController.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<VOGameViewControllerDelegate>
        delegate;

    Swift

    weak var delegate: VOGameViewControllerDelegate? { get set }
  • Default Initializer for the VOHtmlGameViewController.

    Declaration

    Objective-C

    + (nonnull instancetype)
        htmlGameViewControllerWithHtmlGameData:(nonnull VOHtmlGameData *)gameData
                                   vouchrTheme:(nonnull VOTheme *)vouchrTheme
                               dialogViewTheme:(nonnull VOTheme *)dialogViewTheme
                                   loadingView:(nullable id<VOLoadingViewProtocol>)
                                                   loadingView
                                       creator:(nullable VOUser *)creator
                                      gameMode:(VOGameMode)gameMode;

    Parameters

    gameData

    - The VOHtmlGameData to be played.

    vouchrTheme

    - The theme for the view controller.

    loadingView

    - A view with loading indication to be displayed when the view controller is processing information. The loading view will be constrained to the top of the view controller’s view.

    creator

    - The creator of the VOGameData.

    gameMode

    - The current mode for the game. See VOGameMode for the different options.

  • This method should be called when a user no longer requires the game session.

    Note

    The HTML game will still continue to run when modal screens are presented on top of this view controller. Call this method if the game running in the background is not desired.

    Note

    The current game data will not be saved.

    Declaration

    Objective-C

    - (void)endGameSession;

    Swift

    func endGameSession()
  • This method reinstantiates the game instance.

    Note

    Call this method to reininitalize the game if endGameSession has been called.

    Declaration

    Objective-C

    - (void)setupGameSession;

    Swift

    func setupGameSession()