iOS Developer Library

Developer

iAd Framework Reference ADInterstitialAd Class Reference

Options
Deployment Target:

On This Page
Language:

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. More...

Inheritance


Conforms To


Import Statement


import iAd @import iAd;

Availability


Available in iOS 4.3 and later.
  • delegate delegate Property

    The delegate of the interstitial ad object.

    Declaration

    Swift

    weak var delegate: ADInterstitialAdDelegate!

    Objective-C

    @property(nonatomic, weak) id< ADInterstitialAdDelegate > delegate

    Discussion

    Your application sets a delegate to be notified when the state of the ad object changes.

    Import Statement

    import iAd

    Availability

    Available in iOS 4.3 and later.

  • loaded loaded Property

    A Boolean value that states whether the interstitial ad object has downloaded an advertisement. (read-only)

    Declaration

    Swift

    var loaded: Bool { get }

    Objective-C

    @property(nonatomic, readonly, getter=isLoaded) BOOL loaded

    Discussion

    After your application creates an ad object, it automatically downloads content from the iAd Network. The value of this property is YEStrue if the ad object has finished loading advertising content, otherwise the value of this property is NOfalse. Do not poll the value of this property to determine whether an advertisement has been loaded; instead, implement the delegate’s interstitialAdDidLoad: method.

    Import Statement

    import iAd

    Availability

    Available in iOS 4.3 and later.

  • Presents a full screen advertisement modally to the user.

    Declaration

    Objective-C

    - (void)presentFromViewController:(UIViewController *)viewController

    Parameters

    viewController

    The view controller to present the ad.

    Discussion

    Your application presents a full-screen advertisement modally when it requires the user to interact with the advertisement before continuing to the next screen of content in your application. For example, a game might present a modal advertisement after the player finishes playing a match; the player must dismiss the advertisement before beginning another match. When the modal advertisement is dismissed by the user, the advertisement is removed from the screen and its contents are unloaded from memory.

    An ad object throws an exception if your application presents the ad before it finishes loading content from the iAd Network.

    Import Statement

    Availability

    Available in iOS 4.3 and later.

    Deprecated in iOS 7.0.

  • Displays the advertisement within an application view.

    Declaration

    Swift

    func presentInView(_ containerView: UIView!) -> Bool

    Objective-C

    - (BOOL)presentInView:(UIView *)containerView

    Parameters

    containerView

    A screen sized view provided by your application to hold the ad.

    Return Value

    YEStrue if the ad was added successfully, otherwise NOfalse.

    Discussion

    Your application presents a full-screen advertisement in a view when it wants the advertisement to be displayed seamlessly alongside other content, such as in a magazine layout. Typically the view is added as a subview of a scroll view configured to display its contents on page boundaries. An advertisement presented by a view expires after a period of 5 to 15 minutes. If the advertisement was offscreen when it expired, it is immediately unloaded from memory; otherwise, the advertisement is unloaded as soon as it moves offscreen.

    An ad object throws an exception if your application presents the ad before it finishes loading content from the iAd Network.

    The view passed into this method must be part of a view hierarchy managed by a view controller and must be large enough to accomodate the advertisement’s contents. The width of the view must be exactly the width of the screen. The height of the view may be up to 113 pixels shorter than the height of the screen. If your view’s size does not meet these requirements, the method returns NOfalse to your application, and the advertisement is not added to the view. See iOS Human Interface Guidelines for more information.

    While your view is displaying an advertisement, the advertisement completely covers any other content in the view. When the ad’s contents are unloaded, the advertisement is automatically removed from your view.

    Import Statement

    import iAd

    Availability

    Available in iOS 4.3 and later.

  • A Boolean value that states whether the ad is currently executing an action. (read-only)

    Declaration

    Swift

    var actionInProgress: Bool { get }

    Objective-C

    @property(nonatomic, readonly, getter=isActionInProgress) BOOL actionInProgress

    Discussion

    When the user taps on the ad, the advertisement triggers an action, displaying a media rich, interactive advertisement to the user. The value of this property is YEStrue when an advertisement controls the screen, otherwise the value of this property is NOfalse.

    Your application should avoid polling this property to determine when an action starts or stops. Instead, implement the delegate methods to detect when actions begin or end.

    Import Statement

    import iAd

    Availability

    Available in iOS 4.3 and later.

  • Cancels an executing advertisement.

    Declaration

    Swift

    func cancelAction()

    Objective-C

    - (void)cancelAction

    Discussion

    An advertisement that is executing on top of your application completely covers your application’s user interface, but your application continues to run. If your application receives an event that requires the user’s attention, it can programmatically cancel the advertisement so that its normal interface is restored. The ad’s delegate is not called when your application cancels the action; your application is expected to restart any services it paused before the action began executing.

    Canceling actions removes the advertisement from being displayed; frequently canceling advertisements can affect the revenue you earn from using advertisements in your application.

    Import Statement

    import iAd

    Availability

    Available in iOS 4.3 and later.