ALAdViewProtocol Protocol Reference

Declared in ALAdView.h

Overview

This protocol describes a UIView which is capable of loading and showing ads. ALAdView is its sole public concrete implementation.

The functionality of this protocol is exposed via the concrete ALAdView class. To invoke any of its methods, use that; e.g.

ALAdView* adView = [[ALAdView alloc] initWithSize: [ALAdSize sizeBanner]]; [adView loadNextAd];

Ad Delegates

  adLoadDelegate required method

An object conforming to the ALAdLoadDelegate protocol, which, if set, will be notified of ad load events.

@property (strong, atomic, alnullable) id<ALAdLoadDelegate> adLoadDelegate

Discussion

An object conforming to the ALAdLoadDelegate protocol, which, if set, will be notified of ad load events.

Please note: This delegate is retained strongly and might lead to retain cycles if delegate holds strong reference to this ALAdView.

Declared In

ALAdView.h

  adDisplayDelegate required method

An object conforming to the ALAdDisplayDelegate protocol, which, if set, will be notified of ad show/hide events.

@property (strong, atomic, alnullable) id<ALAdDisplayDelegate> adDisplayDelegate

Discussion

An object conforming to the ALAdDisplayDelegate protocol, which, if set, will be notified of ad show/hide events.

Please note: This delegate is retained strongly and might lead to retain cycles if delegate holds strong reference to this ALAdView.

Declared In

ALAdView.h

  adEventDelegate required method

An object conforming to the ALAdViewEventDelegate protocol, which, if set, will be notified of ALAdView-specific events.

@property (strong, atomic, alnullable) id<ALAdViewEventDelegate> adEventDelegate

Discussion

An object conforming to the ALAdViewEventDelegate protocol, which, if set, will be notified of ALAdView-specific events.

Please note: This delegate is retained strongly and might lead to retain cycles if delegate holds strong reference to this ALAdView.

Declared In

ALAdView.h

Ad View Configuration

  adSize required method

The size of ads to be loaded within this ALAdView.

@property (strong, atomic) ALAdSize *adSize

Discussion

The size of ads to be loaded within this ALAdView.

Declared In

ALAdView.h

  zoneIdentifier required method

The zone identifier this ALAdView was initialized with and is loading ads for, if any.

@property (copy, nonatomic, readonly, alnullable) NSString *zoneIdentifier

Discussion

The zone identifier this ALAdView was initialized with and is loading ads for, if any.

Declared In

ALAdView.h

  autoload required method

Whether or not this ALAdView should automatically load and rotate banners.

@property (assign, atomic, getter=isAutoloadEnabled, setter=setAutoloadEnabled:) BOOL autoload

Discussion

Whether or not this ALAdView should automatically load and rotate banners.

If YES, ads will be automatically loaded and updated. If NO, you are reponsible for this behavior via [ALAdView loadNextAd]. Defaults to YES.

Declared In

ALAdView.h

Loading and Rendering Ads

– loadNextAd required method

Start loading a new advertisement. This method will return immediately. An advertisement will be rendered by this view asynchonously when available.

- (void)loadNextAd

Discussion

Start loading a new advertisement. This method will return immediately. An advertisement will be rendered by this view asynchonously when available.

Declared In

ALAdView.h

– render: required method

Render a specific ad that was loaded via ALAdService.

- (void)render:(ALAd *)ad

Parameters

ad

Ad to render. Must not be nil.

Discussion

Render a specific ad that was loaded via ALAdService.

Declared In

ALAdView.h

Initialization

– initWithSize: required method

Initialize the ad view with a given size.

- (instancetype)initWithSize:(ALAdSize *)size

Parameters

size

ALAdSize representing the size of this ad. For example, [ALAdSize sizeBanner].

Return Value

A new instance of ALAdView.

Discussion

Initialize the ad view with a given size.

Declared In

ALAdView.h

– initWithSize:zoneIdentifier: required method

Initialize the ad view for a given size and zone.

- (instancetype)initWithSize:(ALAdSize *)size zoneIdentifier:(alnullable NSString *)zoneIdentifier

Parameters

size

ALAdSize representing the size of this ad. For example, [ALAdSize sizeBanner].

zoneIdentifier

Identifier for the zone this ALAdView should load ads for.

Return Value

A new instance of ALAdView.

Discussion

Initialize the ad view for a given size and zone.

Declared In

ALAdView.h

– initWithSdk:size: required method

Initialize the ad view with a given size.

- (instancetype)initWithSdk:(ALSdk *)sdk size:(ALAdSize *)size

Parameters

sdk

Instance of ALSdk to use.

size

ALAdSize representing the size of this ad. For example, [ALAdSize sizeBanner].

Return Value

A new instance of ALAdView.

Discussion

Initialize the ad view with a given size.

Declared In

ALAdView.h

– initWithFrame:size:sdk: required method

Initialize ad view with a given frame, ad size, and ALSdk instance.

- (instancetype)initWithFrame:(CGRect)frame size:(ALAdSize *)size sdk:(ALSdk *)sdk

Parameters

frame

Frame to use.

size

Ad size to use.

sdk

Instance of ALSdk to use.

Return Value

A new instance of ALAdView.

Discussion

Initialize ad view with a given frame, ad size, and ALSdk instance.

Declared In

ALAdView.h