Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The tagged wrapper is an iOS UIView with a requirement to have accessibilityLabel specified, either from the XCode UI builder or programmatically. This are used to find the views in the Single tag where you want us to add the monetization inventory. You need to add as many as you can, remember that placing a tagged wrapper does not mean we need to use it.

Example

As mentioned tags can be are specified by using the accessibilityLabel to set the tag value, and that can be specified either from the XCodes XCode UI Builder or programmatically, here

Set From Xcode (recommended)

Here is what it looks like in the UI Builder. Here we have a blue wrapper on top and a green one on the bottom. Accordingly, the top wrapper has specified to have a tag named top_wrapper_tag and the one in the bottom bottom_wrapper_tag.

...

Code Block
languageswift
class MyViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do not forget to register.
        R89SDK.shared.registerLifecycle(uiViewController: self)
    }
}

Programmatically (alternative)

As an alternative approach, we can specify the accessibilityLabel programmatically, without using the UI Builder using code, here is the equivalent setup but from the UIViewController.

Code Block
languageswift
class MyViewController: UIViewController {
    
    @IBOutlet var topWrapperUIView:UIView!
    @IBOutlet var bottomWrapperUIView:UIView!

    override func viewDidLoad() {
        super.viewDidLoad()
        //Tag configurations 
        topWrapperUIView.accessibilityLabel = "top_wrapper_tag"
        bottomWrapperUIView.accessibilityLabel = "bottom_wrapper_tag"
        //Registration of UIViewController
        R89SDK.shared.registerLifecycle(uiViewController: self)
    }
}

Note that the tags are named differently but they can be the same as well, in that case, SDK will put the same advertisement in both wrappers, if that is your intended behavior make sure to set getAllWithTag: true while doing the single tag configuration for the screen.

Where To Add The Wrappers?

...

  • We can fill either only one wrapper with a tag or all of them: if you want to exclude some wrappers you need to put a different tag to those views, that is grouping. E.g.: if you want us to fill a wrapper at the bottom of the screen that has the tag ads_wrapper we can fill that. However, if you have multiple wrappers with the same tag, and you want to fill all of them and exclude some others while having the same tag, it’s not possible. We encourage you to ask for advice from our technical support on how to group wrappers.

  • To enable tag lookup in the uiViewController’s view hierarchy you will need to call R89SDK.shared.registerLifecycle(uiViewController: self) to register viewController in the SDK. Keep in mind to call it AFTER tag configurations.

    Code Block
    languageswift
    import UIKit
    import R89SDK
    
    class MyViewController: UIViewController {
        
        @IBOutlet var topWrapperUIView:UIView!
        @IBOutlet var bottomWrapperUIView:UIView!
    
        override func viewDidLoad() {
            super.viewDidLoad()
            //Tag configurations 
            topWrapperUIView.accessibilityLabel = "top_wrapper_tag"
            bottomWrapperUIView.accessibilityLabel = "bottom_wrapper_tag"
            //Registration of UIViewController
            R89SDK.shared.registerLifecycle(uiViewController: self)
        }
    }
    

...