GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADNativeAdView
@interface GADNativeAdView : UIView
Base class for native ad views. Your native ad view must be a subclass of this class and must
call superclass methods for all overridden methods.
-
This property must point to the native ad object rendered by this ad view.
Declaration
Swift
var nativeAd: NativeAd? { get set }
Objective-C
@property (nonatomic, strong, nullable) GADNativeAd *nativeAd;
-
Weak reference to your ad view’s headline asset view.
Declaration
Swift
@IBOutlet weak var headlineView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *headlineView;
-
Weak reference to your ad view’s call to action asset view.
Declaration
Swift
@IBOutlet weak var callToActionView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *callToActionView;
-
Weak reference to your ad view’s icon asset view.
Declaration
Swift
@IBOutlet weak var iconView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *iconView;
-
Weak reference to your ad view’s body asset view.
Declaration
Swift
@IBOutlet weak var bodyView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *bodyView;
-
Weak reference to your ad view’s store asset view.
Declaration
Swift
@IBOutlet weak var storeView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *storeView;
-
Weak reference to your ad view’s price asset view.
Declaration
Swift
@IBOutlet weak var priceView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *priceView;
-
Weak reference to your ad view’s image asset view.
Declaration
Swift
@IBOutlet weak var imageView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *imageView;
-
Weak reference to your ad view’s star rating asset view.
Declaration
Swift
@IBOutlet weak var starRatingView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *starRatingView;
-
Weak reference to your ad view’s advertiser asset view.
Declaration
Swift
@IBOutlet weak var advertiserView: UIView? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIView *advertiserView;
-
Weak reference to your ad view’s media asset view.
Declaration
Swift
@IBOutlet weak var mediaView: MediaView? { get set }
Objective-C
@property (nonatomic, weak, nullable) GADMediaView *mediaView;
-
Weak reference to your ad view’s AdChoices view. Must set adChoicesView before setting
nativeAd, otherwise AdChoices will be rendered according to the preferredAdChoicesPosition
defined in GADNativeAdViewAdOptions.
Declaration
Swift
@IBOutlet weak var adChoicesView: AdChoicesView? { get set }
Objective-C
@property (nonatomic, weak, nullable) GADAdChoicesView *adChoicesView;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADNativeAdView\u003c/code\u003e is the base class for creating native ad views, requiring subclassing and calling superclass methods when overriding.\u003c/p\u003e\n"],["\u003cp\u003eIt provides properties (\u003ccode\u003enativeAd\u003c/code\u003e, \u003ccode\u003eheadlineView\u003c/code\u003e, \u003ccode\u003ecallToActionView\u003c/code\u003e, etc.) to link your custom views with the native ad's assets.\u003c/p\u003e\n"],["\u003cp\u003eThese properties establish weak references to your views, allowing you to control the visual representation of each ad element.\u003c/p\u003e\n"],["\u003cp\u003eYou must set the \u003ccode\u003enativeAd\u003c/code\u003e property to the native ad object being rendered by the view for proper ad display.\u003c/p\u003e\n"],["\u003cp\u003eTo manually position the AdChoices view, set the \u003ccode\u003eadChoicesView\u003c/code\u003e property before setting \u003ccode\u003enativeAd\u003c/code\u003e.\u003c/p\u003e\n"]]],["GADNativeAdView serves as the base class for native ad views, requiring subclasses to override and call superclass methods. It manages the native ad object via the `nativeAd` property. It utilizes weak references to various asset views like `headlineView`, `callToActionView`, `iconView`, `bodyView`, `storeView`, `priceView`, `imageView`, `starRatingView`, `advertiserView`, `mediaView`, and `adChoicesView` for displaying different parts of the ad content. The `adChoicesView` must be set before the `nativeAd`.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADNativeAdView\n===============\n\n\n @interface GADNativeAdView : UIView\n\nBase class for native ad views. Your native ad view must be a subclass of this class and must\ncall superclass methods for all overridden methods.\n- `\n ``\n ``\n `\n\n ### [nativeAd](#/c:objc(cs)GADNativeAdView(py)nativeAd)\n\n `\n ` \n This property must point to the native ad object rendered by this ad view. \n\n #### Declaration\n\n Swift \n\n var nativeAd: NativeAd? { get set }\n\n Objective-C \n\n @property (nonatomic, strong, nullable) ../Classes/GADNativeAd.html *nativeAd;\n\n- `\n ``\n ``\n `\n\n ### [headlineView](#/c:objc(cs)GADNativeAdView(py)headlineView)\n\n `\n ` \n Weak reference to your ad view's headline asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var headlineView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *headlineView;\n\n- `\n ``\n ``\n `\n\n ### [callToActionView](#/c:objc(cs)GADNativeAdView(py)callToActionView)\n\n `\n ` \n Weak reference to your ad view's call to action asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var callToActionView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *callToActionView;\n\n- `\n ``\n ``\n `\n\n ### [iconView](#/c:objc(cs)GADNativeAdView(py)iconView)\n\n `\n ` \n Weak reference to your ad view's icon asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var iconView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *iconView;\n\n- `\n ``\n ``\n `\n\n ### [bodyView](#/c:objc(cs)GADNativeAdView(py)bodyView)\n\n `\n ` \n Weak reference to your ad view's body asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var bodyView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *bodyView;\n\n- `\n ``\n ``\n `\n\n ### [storeView](#/c:objc(cs)GADNativeAdView(py)storeView)\n\n `\n ` \n Weak reference to your ad view's store asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var storeView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *storeView;\n\n- `\n ``\n ``\n `\n\n ### [priceView](#/c:objc(cs)GADNativeAdView(py)priceView)\n\n `\n ` \n Weak reference to your ad view's price asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var priceView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *priceView;\n\n- `\n ``\n ``\n `\n\n ### [imageView](#/c:objc(cs)GADNativeAdView(py)imageView)\n\n `\n ` \n Weak reference to your ad view's image asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var imageView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *imageView;\n\n- `\n ``\n ``\n `\n\n ### [starRatingView](#/c:objc(cs)GADNativeAdView(py)starRatingView)\n\n `\n ` \n Weak reference to your ad view's star rating asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var starRatingView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *starRatingView;\n\n- `\n ``\n ``\n `\n\n ### [advertiserView](#/c:objc(cs)GADNativeAdView(py)advertiserView)\n\n `\n ` \n Weak reference to your ad view's advertiser asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var advertiserView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIView *advertiserView;\n\n- `\n ``\n ``\n `\n\n ### [mediaView](#/c:objc(cs)GADNativeAdView(py)mediaView)\n\n `\n ` \n Weak reference to your ad view's media asset view. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var mediaView: MediaView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) ../Classes/GADMediaView.html *mediaView;\n\n- `\n ``\n ``\n `\n\n ### [adChoicesView](#/c:objc(cs)GADNativeAdView(py)adChoicesView)\n\n `\n ` \n Weak reference to your ad view's AdChoices view. Must set adChoicesView before setting\n nativeAd, otherwise AdChoices will be rendered according to the preferredAdChoicesPosition\n defined in GADNativeAdViewAdOptions. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var adChoicesView: AdChoicesView? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) ../Classes.html#/c:objc(cs)GADAdChoicesView *adChoicesView;"]]