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
@MainActor public var info: String? { get }
-
VideoController provides playback control for ad video.
Declaration
Swift
@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, aUIViewController
object thatAdView
uses 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
AdView
class to display the banner with the specified size.Declaration
Swift
@MainActor 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.
-
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.
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
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.
-
Undocumented
Declaration
Swift
@MainActor override var intrinsicContentSize: CGSize { get }
-
Undocumented
Declaration
Swift
@MainActor override func didMoveToWindow()
-
Undocumented
Declaration
Swift
@MainActor override func point(inside point: CGPoint, with event: UIEvent?) -> Bool