TDBannerView Class Reference
| Inherits from | UIView |
|---|---|
| Declared in | TDBannerView.h |
Overview
The TDBannerView class represents a view that displays Triton Banners (in-stream ads) ads.
The ads are represented by a TDAd object obtained from TDAdLoader. The banner size is independent of its frame size, but when initializing the TDBannerView with one of its initializers, it will make the underlying views size match the banner’s size.
Managing the delegate
delegate
The delegate that will receive state changes from TDBannerView.
@property (nonatomic, weak) id<TDBannerViewDelegate> delegateDeclared In
TDBannerView.h
Creating a TDBannerView
– initWithWidth:andHeight:andFallbackWidth:andFallbackHeight:
Initializes a TDBannerView with origin (0,0) with specified widht and height in addition to fallback width and height.
- (instancetype)initWithWidth:(NSInteger)width andHeight:(NSInteger)height andFallbackWidth:(NSInteger)fallbackWidth andFallbackHeight:(NSInteger)fallbackHeightParameters
width |
The width of the banner |
|---|---|
height |
The height of the banner |
fallbackWidth |
The fallback width of the banner |
fallbackHeight |
The fallback height of the banner |
Discussion
The fallback size must be smaller than the main size otherwise it won’t fit inside the view. This feature was added in order to easily support 320x50 and 300x50 in the same view. The view won’t change it’s size, the fallback view will be centralized inside it.
Declared In
TDBannerView.h
– initWithWidth:andHeight:andFallbackWidth:andFallbackHeight:andOrigin:
Initializes a TDBannerView at the specified origin with specified widht and height in addition to fallback width and height. This is the designated initializer.
- (instancetype)initWithWidth:(NSInteger)width andHeight:(NSInteger)height andFallbackWidth:(NSInteger)fallbackWidth andFallbackHeight:(NSInteger)fallbackHeight andOrigin:(CGPoint)originParameters
width |
The width of the banner |
|---|---|
height |
The height of the banner |
fallbackWidth |
The fallback width of the banner |
fallbackHeight |
The fallback height of the banner |
origin |
a CGPoint with the top left position in points related to its superview |
Discussion
The fallback size must be smaller than the main size otherwise it won’t fit inside the view. This feature was added in order to easily support 320x50 and 300x50 in the same view. The view won’t change it’s size, the fallback view will be centralized inside it.
Declared In
TDBannerView.h
Configuring size and position
width
The width supported by the banner.
@property (assign, readonly) NSInteger widthDeclared In
TDBannerView.h
height
The height supported by the banner.
@property (assign, readonly) NSInteger heightDeclared In
TDBannerView.h
fallbackWidth
The fallback width supported by the banner.
@property (assign, readonly) NSInteger fallbackWidthDeclared In
TDBannerView.h
fallbackHeight
The fallback height supported by the banner.
@property (assign, readonly) NSInteger fallbackHeightDeclared In
TDBannerView.h
– setFallbackWidth:andHeight:
Sets the fallback width and height supported by the banner. The fallback size, when set, will be used in case the main size is not available. It will be centralized inside the banner.
- (void)setFallbackWidth:(NSInteger)fallbackWidth andHeight:(NSInteger)fallbackHeightParameters
fallbackWidth |
The fallback width of the banner |
|---|---|
fallbackHeight |
The fallback height of the banner |
Declared In
TDBannerView.h
– setOrigin:
Changes the top left position of the banner view related to its superview
- (void)setOrigin:(CGPoint)originParameters
origin |
a CGPoint with the new top left position in points related to its superview |
|---|
Declared In
TDBannerView.h