Ad

public protocol Ad

An Ad is an abstract object that represents a single ad, which is a creative in the VAST specification.

Remark

See LinearAd and NonLinearAd
  • A reference to the AdBreak of which the ad is a part of.

    Remark

    The AdBreak property can be already deallocated if no reference is kept elsewhere.

    Declaration

    Swift

    var adBreak: AdBreak? { get }
  • An array of CompanionAds associated to the ad, if available within the same Creatives element.

    Declaration

    Swift

    var companions: [CompanionAd] { get }
  • Either ‘linear’ or ‘nonlinear’, depending on the concrete implementer.

    Declaration

    Swift

    var type: String { get }
  • id

    The identifier of the creative, provided in the VAST-file.

    Declaration

    Swift

    var id: String? { get }
  • When the Ad can be skipped, in seconds.

    Declaration

    Swift

    var skipOffset: Int? { get }
  • The URI of the ad content.

    Remark

    • Only available when the ad is skippable.
    • Only available for LinearAd.

    Declaration

    Swift

    var resourceURI: String? { get }
  • The width of the advertisement, in pixels.

    Declaration

    Swift

    var width: Int? { get }
  • The height of the advertisement, in pixels.

    Declaration

    Swift

    var height: Int? { get }
  • The kind of the ad integration.

    Remark

    For possible values, see AdIntegrationKind

    Declaration

    Swift

    var integration: AdIntegrationKind { get }
  • The duration of the ad, in seconds.

    Remark

    Only available for LinearAd.

    Declaration

    Swift

    var duration: Int? { get }
  • The url that redirects to the website of the advertiser.

    Declaration

    Swift

    var clickThrough: String? { get }
  • The type of custom ad integration.

    Remark

    Remark:

    Declaration

    Swift

    var customIntegration: String? { get }

    Return Value

    The custom ad integration type.

  • Whether the ad is slate or not

    Declaration

    Swift

    var isSlate: Bool { get }
  • customData Default implementation

    Additional integration-specific data associated with this ad.

    Remark

    The value depends on the ad integration. It may be nil if the integration does not provide any custom data.

    Default Implementation

    Declaration

    Swift

    var customData: [String : Any]? { get }