AFNativeAd Class Reference

Inherits from NSObject
Declared in AFNativeAd.h

Overview

AFNativeAd is a generic adertisement object containing all the information needed to create your own native ads.

  delegate

The object that acts as the delegate of the receiving native ad.

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

Declared In

AFNativeAd.h

  title

Title of the ad.

@property (nonatomic, copy, readonly) NSString *title

Declared In

AFNativeAd.h

  tagline

Tagline of the ad.

@property (nonatomic, copy, readonly) NSString *tagline

Declared In

AFNativeAd.h

  callToAction

Call to action of the ad.

@property (nonatomic, copy, readonly) NSString *callToAction

Declared In

AFNativeAd.h

  iconURL

Icon URL of the ad.

@property (nonatomic, copy, readonly) NSString *iconURL

Declared In

AFNativeAd.h

  screenshotURL

Screenshot URL of the ad.

@property (nonatomic, copy, readonly) NSString *screenshotURL

Declared In

AFNativeAd.h

  starRating

The star rating of the ad (out of 5).

@property (nonatomic, copy, readonly) NSNumber *starRating

Declared In

AFNativeAd.h

– connectViewForDisplay:withClickableViews:

Connect the AFNativeAd object to the view you use for display.

- (void)connectViewForDisplay:(UIView *)view withClickableViews:(NSArray *)clickableViews

Parameters

view

The view you use to render the ad.

clickableViews

(optional) An array of views (e.g. CTA button) that will be used for observing the clicks. By default the the first parameter will be used instead.

Discussion

Note: Calling this method more than one time cancels any previous call.

Declared In

AFNativeAd.h

– disconnectViewForDisplay

Disconnect the AFNativeAd object with any previous connection.

- (void)disconnectViewForDisplay

Declared In

AFNativeAd.h

– downloadAsset:completion:

Download an asset asynchronously.

- (void)downloadAsset:(NSString *)assetURL completion:(void ( ^ ) ( UIImage *image ))completion

Parameters

assetURL

The url of the asset you would like to download. It should be either the icon or the screenshot, or it’ll fail.

completion

The completion block for the callback once the asset is downloaded. If a problem occured, the image variable will be nil. Note: the block is called on the main thread.

Declared In

AFNativeAd.h