SASAd

Objective-C

@interface SASAd : NSObject <NSCopying, NSCoding>

Swift

class SASAd : NSObject, NSCopying, NSCoding

Represents the ad’s properties, as it has been programmed in the Smart Manage interface.

  • The original portrait creative size.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGSize portraitSize;

    Swift

    var portraitSize: CGSize { get }
  • The original landscape creative size.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGSize landscapeSize;

    Swift

    var landscapeSize: CGSize { get }
  • The dictionary used to add extra parameters that you can interpret in your app.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDictionary *extraParameters;

    Swift

    var extraParameters: [AnyHashable : Any]? { get }
  • The original aspect ratio of the creative.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat aspectRatio;

    Swift

    var aspectRatio: CGFloat { get }
  • A string which contains useful informations about the ad.

    This string can be sent to the Smart AdServer support to improve bug resolution if the issue is related to a given ad, or can be used with your app crash reporting tool to analyze crash sources.

    Warning

    The string content and format is not guaranted to stay the same: you should avoid parsing it.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull debugString;

    Swift

    var debugString: String { get }
  • Returns the recommanded height to display the ad in a given container, according to the creative’s aspect ratio.

    If no size is defined for the creative, this method will compute the recommanded height using a 32:5 aspect ratio (standard iOS banner ratio).

    Declaration

    Objective-C

    - (CGFloat)optimalAdHeightForContainer:(nullable UIView *)container;

    Swift

    func optimalAdHeight(forContainer container: UIView?) -> CGFloat

    Parameters

    container

    The container in which the ad will be displayed (if nil, the current window will be used instead).

    Return Value

    The optimized height for the ad view.