BannerView

@objcMembers
public class BannerView:
    UIView,
    BannerAdLoaderDelegate,
    AdLoadFlowControllerDelegate,
    BannerEventInteractionDelegate,
    DisplayViewInteractionDelegate

The view that will display the particular banner ad. Built for rendering type of integration.

  • The ad unit configuration.

    Declaration

    Swift

    public let adUnitConfig: AdUnitConfig
  • The event handler for banner view events.

    Declaration

    Swift

    public let eventHandler: BannerEventHandler?

Public Properties

  • Banner-specific parameters.

    Declaration

    Swift

    public var bannerParameters: BannerParameters { get }
  • Video-specific parameters.

    Declaration

    Swift

    public var videoParameters: VideoParameters { get }
  • The last bid response received.

    Declaration

    Swift

    public var lastBidResponse: BidResponse? { get }
  • ID of Stored Impression on the Prebid server

    Declaration

    Swift

    public var configID: String { get }
  • The interval for refreshing the ad.

    Declaration

    Swift

    public var refreshInterval: TimeInterval { get set }
  • Additional sizes for the ad.

    Declaration

    Swift

    public var additionalSizes: [CGSize]? { get set }
  • The ad format (e.g., banner, video).

    Declaration

    Swift

    public var adFormat: AdFormat { get set }
  • The position of the ad on the screen.

    Declaration

    Swift

    public var adPosition: AdPosition { get set }
  • ORTB configuration string.

    Declaration

    Swift

    public weak var delegate: BannerViewDelegate?

Public Methods

  • Initializes a new BannerView.

    Declaration

    Swift

    public init(
        frame: CGRect,
        configID: String,
        adSize: CGSize,
        eventHandler: BannerEventHandler
    )

    Parameters

    frame

    The frame rectangle for the view.

    configID

    The configuration ID for the ad unit.

    adSize

    The size of the ad.

    eventHandler

    The event handler for the banner view.

  • Convenience initializer for creating a BannerView with a configuration ID and event handler.

    Declaration

    Swift

    public convenience init(
        configID: String,
        eventHandler: BannerEventHandler
    )

    Parameters

    configID

    The configuration ID for the ad unit.

    eventHandler

    The event handler for the banner view.

  • Convenience initializer for creating a BannerView with a frame, configuration ID, and ad size.

    Declaration

    Swift

    public convenience init(
        frame: CGRect,
        configID: String,
        adSize: CGSize
    )

    Parameters

    frame

    The frame rectangle for the view.

    configID

    The configuration ID for the ad unit.

    adSize

    The size of the ad.

  • Loads the ad for the banner view.

    Declaration

    Swift

    public func loadAd()
  • Sets the stored auction response.

    Declaration

    Swift

    public func setStoredAuctionResponse(storedAuction: String)

    Parameters

    storedAuction

    The stored auction response string.

Arbitrary ORTB Configuration

  • Sets the impression-level OpenRTB configuration string for the ad unit.

    Declaration

    Swift

    @objc
    public func setImpORTBConfig(_ ortbConfig: String?)

    Parameters

    ortbObject

    The impression-level OpenRTB configuration string to set. Can be nil to clear the configuration.

  • Returns the impression-level OpenRTB configuration string.

    Declaration

    Swift

    @objc
    public func getImpORTBConfig() -> String?
  • Stops the auto-refresh of the ad.

    Declaration

    Swift

    public func stopRefresh()

Custom Renderer

DisplayViewInteractionDelegate

BannerAdLoaderDelegate

PBMAdLoadFlowControllerDelegate

BannerEventInteractionDelegate