MANativeAdView.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // MANativeAdView.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 5/22/20.
  6. //
  7. #import <UIKit/UIKit.h>
  8. @class MANativeAd;
  9. @class MANativeAdViewBinder;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * Base view class containing native ad templates for banners, leaders, and mrecs.
  13. *
  14. * NOTE: The IBOutlets binding doesn't work in interface builder once the SDK is distributed as xcframeworks. Use the -[MANativeAdView bindViewsWithAdViewBinder:] to bind the native ad views.
  15. * Alternatively, you can manually import this header file into your project to use interface builder outlets to bind the views.
  16. */
  17. @interface MANativeAdView : UIView
  18. /**
  19. * The native ad title label.
  20. */
  21. @property (nonatomic, weak) IBOutlet UILabel *titleLabel;
  22. /**
  23. * The native ad advertiser label.
  24. */
  25. @property (nonatomic, weak) IBOutlet UILabel *advertiserLabel;
  26. /**
  27. * The native ad body label.
  28. */
  29. @property (nonatomic, weak) IBOutlet UILabel *bodyLabel;
  30. /**
  31. * The native ad CTA button.
  32. */
  33. @property (nonatomic, weak, nullable) IBOutlet UIButton *callToActionButton;
  34. /**
  35. * The native ad icon ImageView.
  36. */
  37. @property (nonatomic, weak) IBOutlet UIImageView *iconImageView;
  38. /**
  39. * The native ad icon view.
  40. */
  41. @property (nonatomic, weak) IBOutlet UIView *iconContentView __deprecated_msg("iconContentView is deprecated and will be removed in the future. Use iconImageView instead.");
  42. /**
  43. * The native ad options view.
  44. */
  45. @property (nonatomic, weak) IBOutlet UIView *optionsContentView;
  46. /**
  47. * The native ad media view for holding an arbitrary content view provided by the 3rd-party SDK.
  48. */
  49. @property (nonatomic, weak) IBOutlet UIView *mediaContentView;
  50. /**
  51. * The native ad star rating view for holding the star rating view.
  52. */
  53. @property (nonatomic, weak) IBOutlet UIView *starRatingContentView;
  54. /**
  55. * Binds the native asset ad views to this native ad using view tags.
  56. */
  57. - (void)bindViewsWithAdViewBinder:(MANativeAdViewBinder *)adViewBinder;
  58. + (instancetype)nativeAdViewFromAd:(MANativeAd *)ad;
  59. + (instancetype)nativeAdViewFromAd:(nullable MANativeAd *)ad withTemplate:(nullable NSString *)templateType;
  60. @end
  61. NS_ASSUME_NONNULL_END