YMAAdSize
Objective-C
@interface YMAAdSize : NSObject
Swift
class YMAAdSize : NSObject
This class is responsible for the banner size.
The initial size of the banner.
-[YMAAdViewDelegate adViewDidLoad:]
method of the YMAAdViewDelegate
class. Declaration
Objective-C
@property (nonatomic, readonly) CGSize size;
Swift
var size: CGSize { get }
Deprecated
Use flexibleSizeWithCGSize: or stickySizeWithContainerWidth: instead of fixedSizeWithCGSize:. Fixed YMAAdSize API will be removed starting from version 6.*
Creates an object of the YMAAdSize
class with the specified maximum height and width of the banner.
Declaration
Objective-C
+ (nonnull instancetype)fixedSizeWithCGSize:(CGSize)size;
Swift
class func fixedSize(with size: CGSize) -> Self
Parameters
size | Maximum size available for a banner. |
size | Maximum size available for a banner. |
Return Value
An object of the YMAAdSize
class with the fixed size.
Creates an object of the YMAAdSize
class with the specified maximum height and width of the banner.
If the actual size of the banner is less than the size of the container, an adaptive layer is drawn under the banner.
Declaration
Objective-C
+ (nonnull instancetype)flexibleSizeWithCGSize:(CGSize)size;
Swift
class func flexibleSize(with size: CGSize) -> Self
Parameters
size | Maximum size available for a banner. |
size | Maximum size available for a banner. |
Return Value
An object of the YMAAdSize
class with the specified maximum size of the banner.
Creates an object of the YMAAdSize
class with the specified width of a sticky banner.
Declaration
Objective-C
+ (nonnull instancetype)stickySizeWithContainerWidth:(CGFloat)width;
Swift
class func stickySize(withContainerWidth width: CGFloat) -> Self
Parameters
width | Width of the banner. |
width | Width of the banner. |
Return Value
An object of the YMAAdSize
class with the specified width of a sticky banner.