Class

ADInterstitialAd

The ADInterstitialAd class provides full-screen advertisements that your iPad application can display to the user. When the user taps a full-screen advertisement, the advertisement launches a full-screen ad with rich media and interactive capabilities. Your application is notified when the advertisement is launched, but does not otherwise interact with the ad. You receive revenue when users view the advertisements or interact with the advertisements displayed by your application.

Overview

To use a full-screen ad in your application, instantiate a new ADInterstitialAd object and set its delegate; your delegate is called when the ad finishes loading its content from the iAd network. Each full-screen ad only loads a single advertisement during its lifetime; each time your application wants to display a new advertisement, it must create a new ADInterstitialAd object.

After your ad object loads its content, your application can display the ad in one of two ways. To display the content modally, your application presents by calling the ad object’s presentFromViewController: method, passing in a view controller to display the content. A modal advertisement interrupts the flow of control, requiring the user to either interact with the ad or explicitly close it before the application completes the user’s current task. Alternatively, your application can create a full-screen view and call the ad object’s present(in:) method to host the advertisement in that view. A view-based advertisement is almost always added as a subview to a UIScrollView object; this allows the advertisement to be scrolled on and off the screen alongside other pages of content provided by your application.

Regardless of how your application displays the full-screen advertisement, users interact with the advertisement by tapping on it. When a user taps the advertisement, your delegate’s interstitialAdActionShouldBegin:willLeaveApplication: is called to pause your application’s actives, after which the ad downloads the rich media experience from the iAd network and displays it to the user. After the user finishes interacting with the ad, the delegate’s interstitialAdActionDidFinish: method is called to complete the action.

After an advertisement expires, it is automatically removed from the screen. The ad object calls the delegate’s interstitialAdDidUnload: method to notify your application that the advertisement is no longer being displayed. At a minimum, your application should release the ad object, but your application may want to perform additional cleanup tasks. For example, if your application created a view to display the advertisement, it may want to remove that view from the view hierarchy or provide new content to be displayed in that view.

Subclassing Notes

The ADInterstitialAd class may not be subclassed.

Topics

Setting and Getting the Delegate

var delegate: ADInterstitialAdDelegate?

The delegate of the interstitial ad object.

Determining If an Interstitial Ad Has Loaded

var isLoaded: Bool

A Boolean value that states whether the interstitial ad object has downloaded an advertisement.

Presenting an Advertisement

func present(in: UIView)

Displays the advertisement within an application view.

Handling Ad Actions

var isActionInProgress: Bool

A Boolean value that states whether the ad is currently executing an action.

func cancelAction()

Cancels an executing advertisement.

Relationships

Inherits From

Conforms To