SASNativeAdViewBinderBuilder
Objective-C
@interface SASNativeAdViewBinderBuilder : NSObject
Swift
class SASNativeAdViewBinderBuilder : NSObject
Builder than can be use to instantiate a SASNativeAdViewBinder
instance.
-
Initialize a new instance of SASNativeAdViewBinderBuilder.
Declaration
Objective-C
- (nonnull instancetype)initWithBaseView:(nonnull UIView *)baseView;
Swift
init(baseView: UIView)
Parameters
baseView
The view containing of the other views of the native ad.
Return Value
An initialized instance of SASNativeAdViewBinderBuilder.
-
Build an instance of SASNativeAdViewBinder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinder *)build;
Swift
func build() -> SASNativeAdViewBinder
Return Value
An initialized instance of SASNativeAdViewBinder.
-
Set the label displaying the ad title on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withTitleLabel: (nonnull UILabel *)titleLabel;
Swift
func withTitleLabel(_ titleLabel: UILabel) -> SASNativeAdViewBinderBuilder
Parameters
titleLabel
The label displaying the ad title.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the label displaying the ad body on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withBodyLabel: (nonnull UILabel *)bodyLabel;
Swift
func withBodyLabel(_ bodyLabel: UILabel) -> SASNativeAdViewBinderBuilder
Parameters
bodyLabel
The label displaying the ad body.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the button displaying the ad call to action on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withCallToActionButton: (nonnull UIButton *)callToActionButton;
Swift
func withCallToActionButton(_ callToActionButton: UIButton) -> SASNativeAdViewBinderBuilder
Parameters
callToActionButton
The button displaying the ad call to action.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the label displaying the ad advertiser on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withAdvertiserLabel: (nonnull UILabel *)advertiserLabel;
Swift
func withAdvertiserLabel(_ advertiserLabel: UILabel) -> SASNativeAdViewBinderBuilder
Parameters
advertiserLabel
The label displaying the ad advertiser.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the rating bar displaying the ad rating on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withRatingBar: (nonnull UIView<SASRatingBar> *)ratingBar;
Swift
func withRatingBar(_ ratingBar: any UIView & SASRatingBar) -> SASNativeAdViewBinderBuilder
Parameters
ratingBar
The rating bar displaying the ad rating.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the view displaying the ad icon on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withIconView: (nonnull UIView *)iconView;
Swift
func withIconView(_ iconView: UIView) -> SASNativeAdViewBinderBuilder
Parameters
iconView
The view displaying the ad icon.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the view displaying the ad main content on the builder.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withMainView: (nonnull UIView *)mainView;
Swift
func withMainView(_ mainView: UIView) -> SASNativeAdViewBinderBuilder
Parameters
mainView
The view displaying the ad main content.
Return Value
This instance of SASNativeAdViewBinderBuilder.
-
Set the view that will contain the ad customer feedback button on the builder.
Note
Displaying the customer feedback button is mandatory. If no container is set, the customer feedback button will be added in the top right corner of the base view.
Declaration
Objective-C
- (nonnull SASNativeAdViewBinderBuilder *)withCustomerFeedbackContainerView: (nonnull UIView *)customerFeedbackContainerView;
Swift
func withCustomerFeedbackContainerView(_ customerFeedbackContainerView: UIView) -> SASNativeAdViewBinderBuilder
Parameters
customerFeedbackContainerView
The view that will contain the ad customer feedback button.
Return Value
This instance of SASNativeAdViewBinderBuilder.