FeedAdCollectionViewAdapter

@objc(YMAFeedAdCollectionViewAdapter)
@objcMembers
@MainActor
public final class FeedAdCollectionViewAdapter : NSObject

An adapter that bridges a FeedAd to a UICollectionView, providing data source and delegate objects for it.

  • The data source to assign to a UICollectionView.

    Declaration

    Swift

    @MainActor
    public var dataSource: UICollectionViewDataSource { get }
  • The delegate to assign to a UICollectionView.

    Declaration

    Swift

    @MainActor
    public var delegate: UICollectionViewDelegateFlowLayout { get }
  • Creates a collection view adapter for the given feed ad.

    Declaration

    Swift

    @MainActor
    public init(feedAd: FeedAd)

    Parameters

    feedAd

    The feed ad to display in a collection view.

  • Registers the feed ad cell classes with the given collection view. Call this before setting the adapter’s data source and delegate on the collection view.

    Declaration

    Swift

    @MainActor
    public func registerCells(in collectionView: UICollectionView)

    Parameters

    collectionView

    The collection view to register cells with.