MACollectionViewAdPlacer.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // MACollectionViewAdPlacer.h
  3. // AppLovinSDK
  4. //
  5. // Created by Ritam Sarmah on 3/8/22.
  6. //
  7. #import <AppLovinSDK/MACustomAdPlacer.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. /**
  10. * This class loads and places native ads into a corresponding @c UICollectionView. The collection view's original data source and delegate methods are wrapped by this class in order to automatically insert ad items, while maintaining the existing collection view's behavior.
  11. *
  12. * @note If you're using storyboards, the collection view's "Estimate Size" must be set to "None".
  13. */
  14. @interface MACollectionViewAdPlacer : MACustomAdPlacer
  15. /**
  16. * Whether or not unfilled ad positions should be collapsed to appear hidden. Defaults to @c YES.
  17. *
  18. * The default behavior works best for collection views that have a single content item per row/column. If the collection view has multiple items per row/column, disabling this feature may prevent items from unexpected re-positioning, depending on configured content size and ad positions.
  19. */
  20. @property (nonatomic, assign, getter=shouldCollapseEmptyAds) BOOL collapseEmptyAds;
  21. /**
  22. * Initializes an ad placer for use with the provided collection view.
  23. *
  24. * @param collectionView A collection view to place ads in.
  25. * @param settings An ad placer settings object.
  26. */
  27. + (instancetype)placerWithCollectionView:(UICollectionView *)collectionView settings:(MAAdPlacerSettings *)settings;
  28. - (instancetype)initWithSettings:(MAAdPlacerSettings *)settings NS_UNAVAILABLE;
  29. - (instancetype)init NS_UNAVAILABLE;
  30. + (instancetype)new NS_UNAVAILABLE;
  31. @end
  32. NS_ASSUME_NONNULL_END