Stay organized with collections
Save and categorize content based on your preferences.
IMACompanionAdSlot
@interfaceIMACompanionAdSlot:NSObject
Ad slot for companion ads. The SDK will put a subview inside the provided
UIView container. The companion will be matched to the width and height
provided here. This class cannot be instantiated on tvOS, where companion ads
are not available.
[[["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\u003eIMACompanionAdSlot\u003c/code\u003e manages companion ads, displayed in a provided UIView container, matched to specified dimensions.\u003c/p\u003e\n"],["\u003cp\u003eIt's crucial to display the designated \u003ccode\u003eview\u003c/code\u003e in your app before the video ad starts for the companion ad to appear.\u003c/p\u003e\n"],["\u003cp\u003eYou can initialize \u003ccode\u003eIMACompanionAdSlot\u003c/code\u003e with fixed dimensions (width & height) or as fluid, adapting to the container.\u003c/p\u003e\n"],["\u003cp\u003eA delegate (\u003ccode\u003eIMACompanionDelegate\u003c/code\u003e) can be assigned to receive events related to the companion ad slot.\u003c/p\u003e\n"],["\u003cp\u003eCompanion ads are unavailable on tvOS, so this class cannot be instantiated on that platform.\u003c/p\u003e\n"]]],[],null,["IMACompanionAdSlot \n\n @interface IMACompanionAdSlot : NSObject\n\nAd slot for companion ads. The SDK will put a subview inside the provided\nUIView container. The companion will be matched to the width and height\nprovided here. This class cannot be instantiated on tvOS, where companion ads\nare not available.\n- `\n ``\n ``\n `\n\n [view](#/c:objc(cs)IMACompanionAdSlot(py)view)`\n ` \n The view the companion will be rendered in. Display this view in your\n application before video ad starts. \n\n Declaration \n Swift \n\n var view: UIView { get }\n\n Objective-C \n\n @property (nonatomic, readonly) UIView *_Nonnull view;\n\n- `\n ``\n ``\n `\n\n [width](#/c:objc(cs)IMACompanionAdSlot(py)width)`\n ` \n Width of the slot, in pixels. This value is sent to the DFP ad server for\n targeting. \n\n Declaration \n Swift \n\n var width: Int { get }\n\n Objective-C \n\n @property (nonatomic, readonly) NSInteger width;\n\n- `\n ``\n ``\n `\n\n [height](#/c:objc(cs)IMACompanionAdSlot(py)height)`\n ` \n Height of the slot, in pixels. This value is sent to the DFP ad server for\n targeting. \n\n Declaration \n Swift \n\n var height: Int { get }\n\n Objective-C \n\n @property (nonatomic, readonly) NSInteger height;\n\n- `\n ``\n ``\n `\n\n [delegate](#/c:objc(cs)IMACompanionAdSlot(py)delegate)`\n ` \n The IMACompanionDelegate for receiving events from the companion ad slot. \n\n Declaration \n Swift \n\n weak var delegate: (any ../Protocols/IMACompanionDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/IMACompanionDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n [-initWithView:width:height:](#/c:objc(cs)IMACompanionAdSlot(im)initWithView:width:height:)`\n ` \n Initializes an instance of a IMACompanionAdSlot with design ad width and height. \n\n Declaration \n Swift \n\n init(view: UIView, width: Int, height: Int)\n\n Objective-C \n\n - (nonnull instancetype)initWithView:(nonnull UIView *)view\n width:(NSInteger)width\n height:(NSInteger)height;\n\n Parameters\n\n |----------------|-----------------------------------------------|\n | ` `*view*` ` | the UIView that will contain the companion ad |\n | ` `*width*` ` | the chosen width of the ad |\n | ` `*height*` ` | the chosen height of the ad |\n\n Return Value\n\n the IMACompanionAdSlot instance\n- `\n ``\n ``\n `\n\n [-initWithView:](#/c:objc(cs)IMACompanionAdSlot(im)initWithView:)`\n ` \n Initializes an instance of a IMACompanionAdSlot with fluid size. \n\n Declaration \n Swift \n\n init(view: UIView)\n\n Objective-C \n\n - (nonnull instancetype)initWithView:(nonnull UIView *)view;\n\n Parameters\n\n |--------------|------------------------------------------------|\n | ` `*view*` ` | the UIView that will contain the companion ad. |\n\n Return Value\n\n the IMACompanionAdSlot instance"]]