BannerAdView

@objc(YMABannerAdView)
@objcMembers
@MainActor
public class BannerAdView : UIView

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

  • Information about the ad.

    Declaration

    Swift

    @MainActor
    public var adInfo: AdInfo? { get }
  • 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 BannerAdView uses to show a modal controller in response to the user interacting with the banner).

    Declaration

    Swift

    @MainActor
    public weak var delegate: BannerAdViewDelegate?
  • Initializes an object of the BannerAdView class to display the banner with the specified size.

    Declaration

    Swift

    @MainActor
    public convenience init(adSize: BannerAdSize)

    Parameters

    adSize

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

Proxy

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

    Declaration

    Swift

    @objc(displayAtTopInView:)
    @MainActor
    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:)
    @MainActor
    public func displayAtBottom(in view: UIView)

    Parameters

    view

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

  • Loads a banner with the specified targeting data.

    Declaration

    Swift

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

    Parameters

    request

    Data for targeting.

  • Returns the size of the banner content.

    Declaration

    Swift

    @MainActor
    public func adContentSize() -> CGSize

    Return Value

    The size of the banner content.

UIView properties override

  • Undocumented

    Declaration

    Swift

    @MainActor
    override var intrinsicContentSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    @MainActor
    override func didMoveToSuperview()
  • Undocumented

    Declaration

    Swift

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