JWCompanionAdSlot

@available(tvOS, unavailable)
@objcMembers
public class JWCompanionAdSlot : NSObject

A companion ad slot.

This will be used to serve ad accompanying info into your application. The SDK will use the view to render the content.

  • Tag: JWCompanionAdSlot
  • The view the companion will be rendered in.

    Display this view in your application before video ad starts.

    Declaration

    Swift

    public internal(set) var view: UIView! { get }
  • Width of the slot, in pixels. This value is sent to the Google DFP ad server for targeting.

    Regardless the width of the view, this value in conjunction with the provided height are used to determine which companion should be displayed in the provided UIView.

    Use nil in case of expecting fluid companion ads, these companions ads can resize to match the size of the ad slot. They fill 100% of the width of parent view, then resize their height to fit the companion’s content.

    Declaration

    Swift

    public internal(set) var width: Int? { get }
  • Height of the slot, in pixels. This value is sent to the Google DFP ad server for targeting.

    Regardless the height of the view, this value in conjunction with the provided width are used to determine which companion should be displayed in the provided UIView.

    Use nil in case of expecting fluid companion ads, these companions ads can resize to match the size of the ad slot. They fill 100% of the width of parent view, then resize their height to fit the companion’s content.

    Declaration

    Swift

    public internal(set) var height: Int? { get }
  • Creates a companion ad slot.

    This will be used to serve ad accompanying info into your application. The SDK will use the view to render the content.

    Declaration

    Swift

    @objc(initWithView:)
    public init(_ view: UIView)

    Parameters

    view

    A UIView where the SDK will render the ad information.

  • Creates a companion ad slot.

    This will be used to serve ad accompanying info into your application. The SDK will use the view to render the content.

    Declaration

    Swift

    @objc(initWithView:size:)
    public init(_ view: UIView, size: CGSize)

    Parameters

    view

    A UIView where the SDK will render the ad information.

    size

    A size that will be used to set the pixel height and width to send to the Google DFP ad server for targeting.