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-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eIMAAdDisplayContainer\u003c/code\u003e manages the ad container view and companion ad slots for ad playback in iOS apps.\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 later using the \u003ccode\u003ecompanionSlots\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eFriendly obstructions, such as controls overlaid on the ad, can be registered to improve viewability measurement.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers must ensure the \u003ccode\u003eadContainer\u003c/code\u003e and \u003ccode\u003eadContainerViewController\u003c/code\u003e are in the view hierarchy before making ad requests.\u003c/p\u003e\n"]]],[],null,["IMAAdDisplayContainer \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 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 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 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 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 The environment to focus on during an ad break. Nil if there is not currently an ad break. \n\n Declaration \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 List of companion ad slots. Can be nil or empty. \n\n Declaration \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 Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI without any\n companion slots. \n\n Declaration \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 Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI. \n\n Declaration \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 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 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 Unregisters all previously registered friendly obstructions. \n\n Declaration \n Swift \n\n func unregisterAllFriendlyObstructions()\n\n Objective-C \n\n - (void)unregisterAllFriendlyObstructions;"]]