BannerAdViewDelegate

@objc(YMABannerAdViewDelegate)
@MainActor
public protocol BannerAdViewDelegate : NSObjectProtocol

The protocol defines the methods of a delegate that monitors the ads.

Remark

Methods are called by an object of the BannerAdView class when its state changes.
  • Notifies that the banner is loaded.

    Remark

    At this time, you can add BannerAdView if you haven’t done so yet.

    Declaration

    Swift

    @objc
    @MainActor
    func bannerAdViewDidLoad(_ bannerAdView: BannerAdView)

    Parameters

    bannerAdView

    A reference to the object of the BannerAdView class that invoked the method.

  • Notifies that the banner failed to load.

    Declaration

    Swift

    @objc
    @MainActor
    func bannerAdViewDidFailLoading(_ bannerAdView: BannerAdView, error: Error)

    Parameters

    bannerAdView

    A reference to the object of the BannerAdView class that invoked the method.

    error

    Information about the error.

  • Notifies that the user has clicked on the banner.

    Declaration

    Swift

    @objc
    @MainActor
    func bannerAdViewDidClick(_ bannerAdView: BannerAdView)

    Parameters

    bannerAdView

    A reference to the object of the BannerAdView class that invoked the method.

  • Notifies delegate when an impression was tracked.

    Declaration

    Swift

    @objc(bannerAdView:didTrackImpressionWithData:)
    @MainActor
    func bannerAdView(_ bannerAdView: BannerAdView, didTrackImpression impressionData: ImpressionData?)

    Parameters

    bannerAdView

    A reference to the object of the BannerAdView class that invoked the method.

    impressionData

    Ad impression-level revenue data.