BannerAdSize
@objc(YMABannerAdSize)
public final class BannerAdSize : NSObject, Sendable
This class is responsible for the banner size.
-
The initial size of the banner.
Remark
The actual size of the banner is determined when calling theAdViewDelegate.adViewDidLoad:method of theAdViewDelegateclass.Declaration
Swift
@objc public var size: CGSize { get } -
Creates an object of the
BannerAdSizeclass with the specified width and height of the banner. The method is intended for use in Third-Party Mediation. For receiving an adaptive anchor banner located at the top or bottom of the screen usestickySize(withContainerWidth:), for banner in the feed useinlineSize(withWidth:maxHeight:).Declaration
Swift
@objc(fixedSizeWithWidth:height:) public static func fixedSize(withWidth width: CGFloat, height: CGFloat) -> BannerAdSizeParameters
widthWidth of the banner.
heightHeight of the banner.
Return Value
An object of the
BannerAdSizeclass with the fixed size. -
Creates an object of the
BannerAdSizeclass with the specified maximum height and width of the banner.Warning
If the actual size of the banner is less than the size of the container, an adaptive layer is drawn under the banner.Declaration
Swift
@objc(inlineSizeWithWidth:maxHeight:) public static func inlineSize(withWidth width: CGFloat, maxHeight height: CGFloat) -> BannerAdSizeParameters
widthWidth of the banner.
heightMaximum height available for an adaptive banner.
Return Value
An object of the
BannerAdSizeclass with the specified maximum size of the banner. -
Creates an object of the
BannerAdSizeclass with the specified width of the banner.Remark
Returns sticky banner size with the given width.Declaration
Swift
@objc(stickySizeWithContainerWidth:) public static func stickySize(withContainerWidth width: CGFloat) -> BannerAdSizeParameters
widthWidth of the banner.
Return Value
An object of the
BannerAdSizeclass with the specified width of the sticky banner