The ADBannerView class provides a view that displays banner advertisements to the user. When the user taps a banner view, the view triggers an action programmed into the advertisement. For example, an advertisement might show a movie, present a modal advertisement, or launch Safari to show a webpage. Your application is notified when an action starts and stops, but does not otherwise interact with the advertisement. You receive revenue when users see new advertisements or trigger their actions.


The banner view’s delegate is called when a banner view cycles to show a new advertisement as well as when the user interacts with the banner view. For example, your delegate typically pauses your application’s activities when a user taps an advertisement and restores those activities when the user finishes interacting with the advertisement.

A banner view must always use one of the standard sizes defined in Content Size Identifiers. This is to ensure that the advertisement is drawn correctly. You configure the banner view’s requiredContentSizeIdentifiers property with the set of possible sizes your view is allowed to use in your application. To change the size of the banner view, do not set the bounds directly; instead set the currentContentSizeIdentifier property to one of the size identifiers included in that set. You can retrieve the actual dimensions that a particular identifier equates to on a specific device by calling the sizeFromBannerContentSizeIdentifier: class method.

Subclassing Notes

The ADBannerView class provides a self-contained view. Your application should not subclass ADBannerView, nor should your application attempt to change the behavior of the banner view. For example, your application should never add subviews to a banner view.


Managing Ad Types

init?(adType: ADAdType)

Initializes a banner view with the specified ad type.

var adType: ADAdType

The ad type of the banner view.

Setting and Getting the Delegate

var delegate: ADBannerViewDelegate?

The delegate of the banner view.

Configuring the Advertising Shown in a Banner View

var advertisingSection: String?

Reserved for future use.

Determining if a Banner View is Showing an Advertisement

var isBannerLoaded: Bool

A Boolean value that states whether the banner view has downloaded an advertisement.

Banner Actions

var isBannerViewActionInProgress: Bool

A Boolean value that states whether the banner is currently executing an user-triggered action.

func cancelAction()

Cancels an executing banner view action.



This constant defines the iAd framework error domain.

enum ADError.Code

Error codes for the iAd error domain.

enum ADAdType

Constants that indicate the types of ads.