FBNativeAdCollectionViewAdProvider
เวอร์ชั่นที่ใหม่กว่าของคลาสนี้พร้อมแล้ว ตรวจสอบได้ เวอร์ชั่นล่าสุด

Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UICollectionView. 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 collection view.

Superclass:NSObject
Declared in:FBNativeAdCollectionViewAdProvider.h
ทรัพย์สิน
delegate

Passes delegate methods from FBNativeAd. Separate delegate calls will be made for each native ad contained.

@property (nonatomic, weak, nullable) id<FBNativeAdDelegate> delegate;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h
วิธีการทันใจ
adjustCount:forStride:

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

พารามิเตอร์คำอธิบาย
count

The count of cells in the collection view not including ads

stride

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

- (NSUInteger)
adjustCount: (NSUInteger)count
forStride: (NSUInteger)stride;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h
adjustNonAdCellIndexPath:forStride:

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

พารามิเตอร์คำอธิบาย
indexPath

The indexPath to of the non-ad cell

stride

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

- (NSIndexPath *)
adjustNonAdCellIndexPath: (NSIndexPath *)indexPath
forStride: (NSUInteger)stride;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h
collectionView: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 collection view and specifically the caller is recommended to wait until collectionView:cellForRowAtIndexPath: to ensure getting the best native ad for the given collection cell.

พารามิเตอร์คำอธิบาย
collectionView

The collectionView where native ad will be used

indexPath

The indexPath to use as a key for this native ad

- (FBNativeAd *)
collectionView: (UICollectionView *)collectionView
nativeAdForRowAtIndexPath: (NSIndexPath *)indexPath;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h
initWithManager:

Create a FBNativeAdCollectionViewAdProvider.

พารามิเตอร์คำอธิบาย
manager

The FBNativeAdsManager which is consumed by this class.

- (instancetype)
initWithManager: (FBNativeAdsManager *)manager
NS_DESIGNATED_INITIALIZER;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h
isAdCellAtIndexPath:forStride:

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

พารามิเตอร์คำอธิบาย
indexPath

The indexPath of the cell within the collection view

stride

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

- (BOOL)
isAdCellAtIndexPath: (NSIndexPath *)indexPath
forStride: (NSUInteger)stride;
ให้คำรับรองไว้ใน: FBNativeAdCollectionViewAdProvider.h