iOS SDK Version

FBNativeAdTableViewCellProvider

Objective-C
@interfaceFBNativeAdTableViewCellProvider:FBNativeAdTableViewAdProvider<UITableViewDataSource>
Swift
classFBNativeAdTableViewCellProvider:FBNativeAdTableViewAdProvider,UITableViewDataSource
Class which assists in putting FBNativeAdViews into UITableViews. This class manages the creation of UITableViewCells which host native ad views. Functionality is provided to create UITableCellViews as needed for a given indexPath as well as computing the height of the cells.
  • Method to create a FBNativeAdTableViewCellProvider.

    Declaration

    Objective-C
    -(nonnullinstancetype)initWithManager:(nonnullFBNativeAdsManager*)managerforType:(FBNativeAdViewType)type;
    Swift
    convenienceinit(manager:FBNativeAdsManager,fortype:FBNativeAdViewType)

    Parameters

  • Method to create a FBNativeAdTableViewCellProvider.

    Declaration

    Objective-C
    -(nonnullinstancetype)initWithManager:(nonnullFBNativeAdsManager*)managerforType:(FBNativeAdViewType)typeforAttributes:(nonnullFBNativeAdViewAttributes*)attributes;
    Swift
    init(manager:FBNativeAdsManager,fortype:FBNativeAdViewType,forattributes:FBNativeAdViewAttributes)

    Parameters

  • Helper method for implementors of UITableViewDataSource who would like to host native ad UITableViewCells in their table view.

    Declaration

    Objective-C
    -(nonnullUITableViewCell*)tableView:(nonnullUITableView*)tableViewcellForRowAtIndexPath:(nonnullNSIndexPath*)indexPath;
    Swift
    functableView(_tableView:UITableView,cellForRowAtindexPath:IndexPath)->UITableViewCell
  • Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table view.

    Declaration

    Objective-C
    -(CGFloat)tableView:(nonnullUITableView*)tableViewheightForRowAtIndexPath:(nonnullNSIndexPath*)indexPath;
    Swift
    functableView(_tableView:UITableView,heightForRowAtindexPath:IndexPath)->CGFloat
  • Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table view.

    Declaration

    Objective-C
    -(CGFloat)tableView:(nonnullUITableView*)tableViewestimatedHeightForRowAtIndexPath:(nonnullNSIndexPath*)indexPath;
    Swift
    functableView(_tableView:UITableView,estimatedHeightForRowAtindexPath:IndexPath)->CGFloat