FBNativeAdTableViewAdProvider
Es ist eine neuere Version dieser Klasse verfügbar. Sieh sie dir an mit der aktuellsten Version.

Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UITableView. This class contains a mechanism to map indexPaths to native ads in a stable manner as well as helpers which assist in doing the math to include ads at a regular interval within a table view.

Inherits from:NSObject
Declared in:FBNativeAdTableViewAdProvider.h
Instance-Methoden
adjustCount:forStride:

Support for evenly distributed native ads within a table view. Adjusts the total count of cells within the table view to account for the ad cells.

ParameterBeschreibung
count

The count of cells in the table view not including ads

stride

The frequency that native ads are to appear within the table view

- (NSUInteger)
adjustCount: (NSUInteger)count
forStride: (NSUInteger)stride;
Deklariert in: FBNativeAdTableViewAdProvider.h
adjustNonAdCellIndexPath:forStride:

Support for evenly distributed native ads within a table view. Adjusts a non-ad cell indexPath to the indexPath it would be in a collection with no ads.

ParameterBeschreibung
indexPath

The indexPath to of the non-ad cell

stride

The frequency that native ads are to appear within the table view

- (NSIndexPath *)
adjustNonAdCellIndexPath: (NSIndexPath *)indexPath
forStride: (NSUInteger)stride;
Deklariert in: FBNativeAdTableViewAdProvider.h
initWithManager:

Create a FBNativeAdTableViewAdProvider.

ParameterBeschreibung
manager

The FBNativeAdsManager which is consumed by this class.

- (instancetype) initWithManager:(FBNativeAdsManager *)manager;
Deklariert in: FBNativeAdTableViewAdProvider.h
isAdCellAtIndexPath:forStride:

Support for evenly distributed native ads within a table view. Computes whether this cell is an ad or not.

ParameterBeschreibung
indexPath

The indexPath of the cell within the table view

stride

The frequency that native ads are to appear within the table view

- (BOOL)
isAdCellAtIndexPath: (NSIndexPath *)indexPath
forStride: (NSUInteger)stride;
Deklariert in: FBNativeAdTableViewAdProvider.h
tableView:nativeAdForRowAtIndexPath:

Retrieve a native ad for an indexPath, will return the same ad for a given indexPath until the native ads manager is refreshed. This method is intended for usage with a table view and specifically the caller is recommended to wait until tableView:cellForRowAtIndexPath: to ensure getting the best native ad for the given table cell.

ParameterBeschreibung
tableView

The tableView where native ad will be used

indexPath

The indexPath to use as a key for this native ad

- (FBNativeAd *)
tableView: (UITableView *)tableView
nativeAdForRowAtIndexPath: (NSIndexPath *)indexPath;
Deklariert in: FBNativeAdTableViewAdProvider.h