SASNativeAdImage

Objective-C

@interface SASNativeAdImage : NSObject <NSCopying, NSCoding>

Swift

class SASNativeAdImage : NSObject, NSCopying, NSCoding

A SASNativeAdImage represents an image that will be displayed in a native ad.

  • URL

    The URL of the image.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSURL *_Nonnull URL;

    Swift

    var url: URL { get }
  • The width of the image (optional).

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat width;

    Swift

    var width: CGFloat { get }
  • The height of the image (optional).

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat height;

    Swift

    var height: CGFloat { get }
  • Initializes a new native ad image.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURL:(nonnull NSURL *)URL;

    Swift

    init(url URL: URL)

    Parameters

    URL

    The image URL.

    Return Value

    An initialized instance of SASNativeAdImage.

  • Initializes a new native ad image.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURL:(nonnull NSURL *)URL
                                  width:(CGFloat)width
                                 height:(CGFloat)height;

    Swift

    init(url URL: URL, width: CGFloat, height: CGFloat)

    Parameters

    URL

    The image URL.

    width

    The image width.

    height

    The image height.

    Return Value

    An initialized instance of SASNativeAdImage.