AdView

@objc(YMAAdView)
@objcMembers
public class AdView : UIView

This class is responsible for setting up and displaying the banner.

  • It monitors the ad and receives notifications about user interaction with the ad.

    Remark

    It provides data necessary for displaying the ad (for example, a UIViewController object that AdView uses to show a modal controller in response to the user interacting with the banner).

    Declaration

    Swift

    public var adUnitID: String { get }
  • VideoController provides playback control for ad video.

    Declaration

    Swift

    public private(set) lazy var videoController: VideoController { get set }
  • It monitors the ad and receives notifications about user interaction with the ad.

    Remark

    It provides data necessary for displaying the ad (for example, a UIViewController object that AdView uses to show a modal controller in response to the user interacting with the banner).

    Declaration

    Swift

    public weak var delegate: AdViewDelegate?
  • Initializes an object of the AdView class to display the banner with the specified size.

    Declaration

    Swift

    public init(adUnitID: String, adSize: BannerAdSize)

    Parameters

    adUnitID

    The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

    adSize

    The size of the banner. The size of the banner is set in the BannerAdSize class.

    Return Value

    Initializes an object of the AdView class to display the banner with the specified size.

Proxy

  • Displays the banner centered at the top of the passed View.

    Declaration

    Swift

    @objc(displayAtTopInView:)
    public func displayAtTop(in view: UIView)

    Parameters

    view

    Object of the UIView class to add the banner to.

  • Displays the banner centered at the bottom of the passed View.

    Declaration

    Swift

    @objc(displayAtBottomInView:)
    public func displayAtBottom(in view: UIView)

    Parameters

    view

    An object of the UIView class to add the banner to.

  • Loads a banner.

    Declaration

    Swift

    public func loadAd()
  • Loads a banner with data for targeting.

    Declaration

    Swift

    @objc(loadAdWithRequest:)
    public func loadAd(with request: AdRequest?)

    Parameters

    request

    Data for targeting.

  • Returns the size of the banner content.

    Declaration

    Swift

    public func adContentSize() -> CGSize

    Return Value

    The size of the banner content.

UIView properties override

  • Undocumented

    Declaration

    Swift

    override var intrinsicContentSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    override func didMoveToWindow()
  • Undocumented

    Declaration

    Swift

    override func point(inside point: CGPoint, with event: UIEvent?) -> Bool