YMAAdViewDelegate
Objective-C
@protocol YMAAdViewDelegate <NSObject>
Swift
protocol YMAAdViewDelegate : NSObjectProtocol
The protocol defines the methods of the delegate that tracks ads. Methods are called by an object of the YMAAdView
class when its state changes.
- Methods
- -viewControllerForPresentingModalView
- -adViewDidLoad:
- -adViewDidFailLoading:error:
- -adViewDidClick:
- -adViewWillLeaveApplication:
- -adView:willPresentScreen:
- -adView:didDismissScreen:
- -adView:didTrackImpressionWithData:
Returns a UIViewController
object that AdView
uses to show a modal controller in response to the user’s interaction with the banner. Since a single UIViewController
can’t show multiple modal controllers simultaneously, the returned UIViewController
must be displayed in front of all the other ones.
Declaration
Objective-C
- (nullable UIViewController *)viewControllerForPresentingModalView;
Swift
optional func viewControllerForPresentingModalView() -> UIViewController?
Return Value
The UIViewController
object that AdView
uses for showing a modal controller in response to the user’s interaction with the banner.
Notifies that the banner failed to load.
Declaration
Objective-C
- (void)adViewDidFailLoading:(nonnull YMAAdView *)adView
error:(nonnull NSError *)error;
Swift
optional func adViewDidFailLoading(_ adView: YMAAdView, error: Error)
Parameters
adView | A reference to the object of the |
error | Information about the error (for details, see |
adView | A reference to the object of the |
error | Information about the error (for details, see |
Notifies that the app will become inactive now because the user clicked on the banner ad and is about to switch to a different application (Phone, App Store, and so on).
Notifies that the user has clicked on the banner and the in-app browser will open now.
It’s called when an ad impression has been counted.
Declaration
Objective-C
- (void)adView:(nonnull YMAAdView *)adView
didTrackImpressionWithData:(nullable id<YMAImpressionData>)impressionData;