The VIS.X® SDK interstitial integration will provide you access to regular interstitials and the YOC Mystery Ad®, a high-impact fullscreen-overlay powered by YOC.

  1. Import VisxSDK to your UIViewController
  2. Initialize the VisxAdView
  3. Display VisxAdView as an Interstitial
  4. Adding Background Color
Import VisxSDK to your UIViewController

First, import VisxSDK into your UIViewController.

import VisxSDK
Initialize the VisxAdView

A VisxAdView represents an instance of an ad you want to deliver and render as an Interstitial on top of your UIViewController. You have the choice to use either delegates or closures as callbacks.

// Using the initializer with callbacks
adView = VisxAdView(adUnit: "123456",
                    adSize: CGSize(width: 300, height: 250),
                    viewControllerForPresenting: self,
                    interstitial: true)

// Using the initializer with delegates
defaultAdView = VisxAdView(adUnit: "123456", 
                           adViewDelegate: self, 
                           adSize: CGSize(width: 320, height: 480), 
                           interstitial: Bool? = true)
Parameter Description
adUnit VIS.X® Ad Unit ID (provided by YOC)
adViewDelegate VisxAdViewDelegate, usually self
adSize adSize is the default CGSize of your interstitial position
viewControllerForPresenting ViewController which will present interstitial creative`.
interstitial Has to be true.
Display VisxAdView as Interstitial

Next, you need to either conform to the VisxAdViewDelegate or Closures as callbacks to render the ad using the .showInterstitial() method of the VisxAdView.

Using Closures
    adView = VisxAdView(adUnit: "123456",
                        adSize: CGSize(width: 300, height: 250),
                        viewControllerForPresenting: self,
                        interstitial: true)

        .onInitialize { [weak self] visxAdView, effect in
        .onError { [weak self] visxAdView, visxError in
            print("visxAdFailedWithError: \(visxError)")
        .onClose{ [weak self] visxAdView in

Using Delegates
extension MysteryScrollViewController: VisxAdViewDelegate {
    func viewControllerForPresentingVisxAdView() -> UIViewController! {
        return self
    func visxAdViewDidInitialize(_ visxAdView: VisxAdView, effect: VisxPlacementEffect) {
        // Presents the interstitial from the default view controller.
    //optional delegates
    func visxAdFailedWithError(visxAdView: VisxAdView, message: String, code: Int) {
        print("visxAdFailedWithError: message - \(message), status code - \(code)")
    func visxAdInterstitialClosed(visxAdView: VisxAdView) {

Per default, there is a threshold of 30 minutes between load() and showInterstitial() in which the impression needs to be delivered, otherwise, the impression will expire. If required, the expiration timeout can be adjusted by YOC in exceptional cases.

In case of no ad or any other error visxAdFailedWithError delegate will provide additional information via an error message and an error code. All potential error codes and their meanings are listed here).

Adding Background Color

The default background color of interstitials is transparent with a slight opaque for visual separation from the content. If you need an opaque background, make sure to set up the color before rendering the ad, using the setInterstitialBackgroundColor(color: UIColor) of VisxAdView.


Your interstitial placement is fully set up and ready for testing.

We advise you to share a build of your app with the YOC Service Team, to validate and fully test the integration together. Reach out to your contact at YOC to request test resources.