YMAAdView
Objective-C
@interface YMAAdView : UIView
Swift
class YMAAdView : UIView
This class is responsible for setting up and displaying banners.
- Properties
- delegate
- adUnitID
- videoController
- Methods
- -initWithAdUnitID:adSize:
- -displayAtTopInView:
- -displayAtBottomInView:
- -loadAd
- -loadAdWithRequest:
- -adContentSize
An object that implements the YMAAdViewDelegate
protocol that tracks the ad and receives notifications about user interaction with the ad. 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
Objective-C
@property (nonatomic, weak, nullable) id<YMAAdViewDelegate> delegate;
Swift
weak var delegate: YMAAdViewDelegate? { get set }
AdUnit ID is a unique identifier that is issued in the Partner interface and has the format R-M-XXXXXX-Y.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull adUnitID;
Swift
var adUnitID: String { get }
An object of the YMAVideoController
class, which manages the video content in an ad.
Declaration
Objective-C
@property (nonatomic, strong, readonly) YMAVideoController *_Nonnull videoController;
Swift
var videoController: YMAVideoController { get }
Initializes an object of the YMAAdView
class to display the banner with the specified size.
Declaration
Objective-C
- (nonnull instancetype)initWithAdUnitID:(nonnull NSString *)adUnitID
adSize:(nonnull YMAAdSize *)adSize;
Swift
init(adUnitID: String, adSize: YMAAdSize)
Parameters
adUnitID | AdUnit ID is a unique identifier that is issued in the Partner interface and has the format R-M-XXXXXX-Y. |
adSize | The size of the banner. The size of the banner is set in the |
adUnitID | AdUnit ID is a unique identifier that is issued in the Partner interface and has the format R-M-XXXXXX-Y. |
adSize | The size of the banner. The size of the banner is set in the |
Return Value
Initializes an object of the YMAAdView
class to display the banner with the specified size.
Displays the banner centered at the top of the passed View
.
Declaration
Objective-C
- (void)displayAtTopInView:(nonnull UIView *)view;
Swift
func displayAtTop(in view: UIView)
Parameters
view | An object of the |
view | An object of the |
Displays the banner centered at the bottom of the passed View
.
Declaration
Objective-C
- (void)displayAtBottomInView:(nonnull UIView *)view;
Swift
func displayAtBottom(in view: UIView)
Parameters
view | An object of the |
view | An object of the |
Loads a banner with data for targeting.
Declaration
Objective-C
- (void)loadAdWithRequest:(nullable YMAAdRequest *)request;
Swift
func loadAd(with request: YMAAdRequest?)
Parameters
request | Data for targeting ( |
request | Data for targeting ( |