AdView
@objc(YMAAdView)
@objcMembers
@MainActor
public class AdView : UIView
This class is responsible for setting up and displaying the banner.
-
Returns the AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.
Declaration
Swift
@MainActor public var adUnitID: String { get }Return Value
Ad unique identifier.
-
Any string in the ad (set in the Partner interface).
Warning
This property is only used for working with ADFOX.Declaration
Swift
@available(*, deprecated, message: "`info` property is deprecated. Use `adAttributes` property instead.") @MainActor public var info: String? { get } -
Information about additional ad attributes
Declaration
Swift
@MainActor public var adAttributes: [AdAttributes] { get } -
Information about the ad.
Declaration
Swift
@MainActor public var adInfo: AdInfo? { get } -
VideoController provides playback control for ad video.
Declaration
Swift
@available(*, deprecated, message: "`videoController` property will be removed in future versions.") @MainActor 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, aUIViewControllerobject thatAdViewuses to show a modal controller in response to the user interacting with the banner).Declaration
Swift
@MainActor public weak var delegate: AdViewDelegate? -
Initializes an object of the
AdViewclass to display the banner with the specified size.Declaration
Swift
@MainActor public convenience init(adUnitID: String, adSize: BannerAdSize)Parameters
adUnitIDThe AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.
adSizeThe size of the banner. The size of the banner is set in the
BannerAdSizeclass.Return Value
Initializes an object of the
AdViewclass to display the banner with the specified size.
-
Displays the banner centered at the top of the passed
View.Declaration
Swift
@objc(displayAtTopInView:) @MainActor public func displayAtTop(in view: UIView)Parameters
viewObject of the
UIViewclass 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
viewAn object of the
UIViewclass to add the banner to. -
Loads a banner.
Declaration
Swift
@MainActor public func loadAd() -
Loads a banner with data for targeting.
Declaration
Swift
@objc(loadAdWithRequest:) @MainActor public func loadAd(with request: AdRequest?)Parameters
requestData for targeting.
-
Returns the size of the banner content.
Declaration
Swift
@MainActor public func adContentSize() -> CGSizeReturn Value
The size of the banner content.
-
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