View controller containing the ad container. Used to present ad UI in child view controllers. It
must be non-nil in order to make ad or stream requests, and it must be in the view hierarchy
before ad playback.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-14 UTC."],[[["\u003cp\u003eIMAAdDisplayContainer manages the ad container view and companion ad slots for ad playback.\u003c/p\u003e\n"],["\u003cp\u003eIt requires an \u003ccode\u003eadContainer\u003c/code\u003e (UIView) for rendering the ad and an optional \u003ccode\u003eadContainerViewController\u003c/code\u003e (UIViewController) for presenting ad UI.\u003c/p\u003e\n"],["\u003cp\u003eCompanion ad slots can be provided during initialization or left empty.\u003c/p\u003e\n"],["\u003cp\u003eIt allows registering "friendly obstructions" for viewability measurement and provides a method to unregister them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efocusEnvironment\u003c/code\u003e property indicates the focusable element during ad breaks.\u003c/p\u003e\n"]]],[],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAAdDisplayContainer\n=====================\n\n @interface IMAAdDisplayContainer : NSObject\n\nThe IMAAdDisplayContainer is responsible for managing the ad container view and companion ad\nslots used for ad playback.\n- `\n ``\n ``\n `\n\n ### [adContainer](#/c:objc(cs)IMAAdDisplayContainer(py)adContainer)\n\n `\n ` \n View containing the video display and ad related UI. This view must be present in the view\n hierarchy in order to make ad or stream requests. \n\n #### Declaration\n\n Swift \n\n var adContainer: UIView { get }\n\n Objective-C \n\n @property (nonatomic, readonly) UIView *_Nonnull adContainer;\n\n- `\n ``\n ``\n `\n\n ### [adContainerViewController](#/c:objc(cs)IMAAdDisplayContainer(py)adContainerViewController)\n\n `\n ` \n View controller containing the ad container. Used to present ad UI in child view controllers. It\n must be non-nil in order to make ad or stream requests, and it must be in the view hierarchy\n before ad playback. \n\n #### Declaration\n\n Swift \n\n weak var adContainerViewController: UIViewController? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIViewController *adContainerViewController;\n\n- `\n ``\n ``\n `\n\n ### [focusEnvironment](#/c:objc(cs)IMAAdDisplayContainer(py)focusEnvironment)\n\n `\n ` \n The environment to focus on during an ad break. Nil if there is not currently an ad break. \n\n #### Declaration\n\n Swift \n\n var focusEnvironment: (any UIFocusEnvironment)? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) id\u003cUIFocusEnvironment\u003e focusEnvironment;\n\n- `\n ``\n ``\n `\n\n ### [companionSlots](#/c:objc(cs)IMAAdDisplayContainer(py)companionSlots)\n\n `\n ` \n List of companion ad slots. Can be nil or empty. \n\n #### Declaration\n\n Swift \n\n var companionSlots: [../Classes/IMACompanionAdSlot.html]? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSArray\u003c../Classes/IMACompanionAdSlot.html *\u003e *companionSlots;\n\n- `\n ``\n ``\n `\n\n ### [-initWithAdContainer:viewController:](#/c:objc(cs)IMAAdDisplayContainer(im)initWithAdContainer:viewController:)\n\n `\n ` \n Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI without any\n companion slots. \n\n #### Declaration\n\n Swift \n\n init(adContainer: UIView, viewController adContainerViewController: UIViewController?)\n\n Objective-C \n\n - (nonnull instancetype)initWithAdContainer:(nonnull UIView *)adContainer\n viewController:(nullable UIViewController *)\n ../Classes/IMAAdDisplayContainer.html#/c:objc(cs)IMAAdDisplayContainer(py)adContainerViewController;\n\n #### Parameters\n\n |-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*adContainer*` ` | The view where the ad will be rendered. Fills the view's bounds. |\n | ` `*adContainerViewController*` ` | The view controller containing the ad container. If not provided here, must be set on the property before making an ads or stream request. |\n\n #### Return Value\n\n A new IMAAdDisplayContainer instance\n- `\n ``\n ``\n `\n\n ### [-initWithAdContainer:viewController:companionSlots:](#/c:objc(cs)IMAAdDisplayContainer(im)initWithAdContainer:viewController:companionSlots:)\n\n `\n ` \n Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI. \n\n #### Declaration\n\n Swift \n\n init(adContainer: UIView, viewController adContainerViewController: UIViewController?, companionSlots: [../Classes/IMACompanionAdSlot.html]?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithAdContainer:(nonnull UIView *)adContainer\n viewController:(nullable UIViewController *)adContainerViewController\n companionSlots:\n (nullable NSArray\u003c../Classes/IMACompanionAdSlot.html *\u003e *)companionSlots;\n\n #### Parameters\n\n |-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*adContainer*` ` | The view where the ad will be rendered. Fills the view's bounds. |\n | ` `*adContainerViewController*` ` | The view controller containing the ad container. If not provided here, must be set on the property before making an ads or stream request. |\n | ` `*companionSlots*` ` | The array of IMACompanionAdSlots. Can be nil or empty. |\n\n #### Return Value\n\n A new IMAAdDisplayContainer instance\n- `\n ``\n ``\n `\n\n ### [-registerFriendlyObstruction:](#/c:objc(cs)IMAAdDisplayContainer(im)registerFriendlyObstruction:)\n\n `\n ` \n Registers a view that overlays or obstructs this container as \"friendly\" for viewability\n measurement purposes.\n\n See [Open Measurement\n in the IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/ios/omsdk) for guidance on what is and what is not allowed to be registered. \n\n #### Declaration\n\n Swift \n\n func register(_ friendlyObstruction: ../Classes/IMAFriendlyObstruction.html)\n\n Objective-C \n\n - (void)registerFriendlyObstruction:\n (nonnull ../Classes/IMAFriendlyObstruction.html *)friendlyObstruction;\n\n #### Parameters\n\n |-----------------------------|---------------------------------------------------------------|\n | ` `*friendlyObstruction*` ` | An obstruction to be marked as \"friendly\" until unregistered. |\n\n- `\n ``\n ``\n `\n\n ### [-unregisterAllFriendlyObstructions](#/c:objc(cs)IMAAdDisplayContainer(im)unregisterAllFriendlyObstructions)\n\n `\n ` \n Unregisters all previously registered friendly obstructions. \n\n #### Declaration\n\n Swift \n\n func unregisterAllFriendlyObstructions()\n\n Objective-C \n\n - (void)unregisterAllFriendlyObstructions;"]]