GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADNativeAdImage
@interface GADNativeAdImage : NSObject
Native ad image.
-
The image. If image autoloading is disabled, this property will be nil.
Declaration
Swift
var image: UIImage? { get }
Objective-C
@property (nonatomic, strong, readonly, nullable) UIImage *image;
-
Declaration
Swift
var imageURL: URL? { get }
Objective-C
@property (nonatomic, copy, readonly, nullable) NSURL *imageURL;
-
Declaration
Swift
var scale: CGFloat { get }
Objective-C
@property (nonatomic, readonly) CGFloat scale;
-
Initializes and returns a native ad image object with the provided image.
Declaration
Swift
init(image: UIImage)
Objective-C
- (nonnull instancetype)initWithImage:(nonnull UIImage *)image;
-
Initializes and returns a native ad image object with the provided image URL and image scale.
Declaration
Swift
init(url URL: URL, scale: CGFloat)
Objective-C
- (nonnull instancetype)initWithURL:(nonnull NSURL *)URL scale:(CGFloat)scale;
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\u003eGADNativeAdImage\u003c/code\u003e provides a way to access native ad images, including the actual image and its URL.\u003c/p\u003e\n"],["\u003cp\u003eIt offers properties for accessing the image (\u003ccode\u003eimage\u003c/code\u003e), the image URL (\u003ccode\u003eimageURL\u003c/code\u003e), and the image scale (\u003ccode\u003escale\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can initialize a \u003ccode\u003eGADNativeAdImage\u003c/code\u003e instance using either a \u003ccode\u003eUIImage\u003c/code\u003e directly or by providing an image URL and scale.\u003c/p\u003e\n"],["\u003cp\u003eWhen image autoloading is disabled, the \u003ccode\u003eimage\u003c/code\u003e property of a \u003ccode\u003eGADNativeAdImage\u003c/code\u003e object will be \u003ccode\u003enil\u003c/code\u003e, necessitating the use of the \u003ccode\u003eimageURL\u003c/code\u003e for retrieving the image.\u003c/p\u003e\n"]]],["GADNativeAdImage manages images for native ads. It provides access to the `image` itself (if autoloaded), its `imageURL`, and its `scale`. You can initialize a `GADNativeAdImage` instance directly, either with a `UIImage` using `initWithImage:` or with a `URL` and `scale` via `initWithURL:scale:`. The properties `image` and `imageURL` can be null.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADNativeAdImage\n================\n\n\n @interface GADNativeAdImage : NSObject\n\nNative ad image.\n- `\n ``\n ``\n `\n\n ### [image](#/c:objc(cs)GADNativeAdImage(py)image)\n\n `\n ` \n The image. If image autoloading is disabled, this property will be nil. \n\n #### Declaration\n\n Swift \n\n var image: UIImage? { get }\n\n Objective-C \n\n @property (nonatomic, strong, readonly, nullable) UIImage *image;\n\n- `\n ``\n ``\n `\n\n ### [imageURL](#/c:objc(cs)GADNativeAdImage(py)imageURL)\n\n `\n ` \n The image's URL. \n\n #### Declaration\n\n Swift \n\n var imageURL: URL? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) NSURL *imageURL;\n\n- `\n ``\n ``\n `\n\n ### [scale](#/c:objc(cs)GADNativeAdImage(py)scale)\n\n `\n ` \n The image's scale. \n\n #### Declaration\n\n Swift \n\n var scale: CGFloat { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CGFloat scale;\n\n[MediationAdditions\n------------------](#/MediationAdditions)\n\n- `\n ``\n ``\n `\n\n ### [-initWithImage:](#/c:objc(cs)GADNativeAdImage(im)initWithImage:)\n\n `\n ` \n Initializes and returns a native ad image object with the provided image. \n\n #### Declaration\n\n Swift \n\n init(image: UIImage)\n\n Objective-C \n\n - (nonnull instancetype)initWithImage:(nonnull UIImage *)image;\n\n- `\n ``\n ``\n `\n\n ### [-initWithURL:scale:](#/c:objc(cs)GADNativeAdImage(im)initWithURL:scale:)\n\n `\n ` \n Initializes and returns a native ad image object with the provided image URL and image scale. \n\n #### Declaration\n\n Swift \n\n init(url URL: URL, scale: CGFloat)\n\n Objective-C \n\n - (nonnull instancetype)initWithURL:(nonnull NSURL *)URL scale:(CGFloat)scale;"]]