IMACompanionAdSlot

@interface IMACompanionAdSlot : 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.

  • The view the companion will be rendered in. Display this view in your application before video ad starts.

    Declaration

    Swift

    var view: UIView! { get }

    Objective-C

    @property (readonly, strong, nonatomic) UIView *view;
  • Width of the slot, in pixels. This value is sent to the DFP ad server for targeting.

    Declaration

    Swift

    var width: Int32 { get }

    Objective-C

    @property (readonly, nonatomic) int width;
  • Height of the slot, in pixels. This value is sent to the DFP ad server for targeting.

    Declaration

    Swift

    var height: Int32 { get }

    Objective-C

    @property (readonly, nonatomic) int height;
  • The IMACompanionDelegate for receiving events from the companion ad slot.

    Declaration

    Swift

    weak var delegate: IMACompanionDelegate! { get set }

    Objective-C

    @property (readwrite, nonatomic) id<IMACompanionDelegate> delegate;
  • Initializes an instance of a IMACompanionAdSlot with design ad width and height.

    Declaration

    Swift

    init!(view: UIView!, width: Int32, height: Int32)

    Objective-C

    - (instancetype)initWithView:(UIView *)view width:(int)width height:(int)height;

    Parameters

    view

    the UIView that will contain the companion ad

    width

    the desired width of the ad

    height

    the desired height of the ad

    Return Value

    the IMACompanionAdSlot instance