//
//  DemoMoPubNativeAdapterAdView.m
//  sdk-demo-ios-objc
//
//  Created by Smaato Inc on 17.04.20.
//  Copyright © 2020 Smaato Inc. All rights reserved.
//

#import "DemoMoPubNativeAdapterAdView.h"
#import <MoPub/MoPub.h>

@interface DemoMoPubNativeAdapterAdView() <MPNativeAdRendering>

@property(nonatomic, weak) IBOutlet UILabel *titleTextLabel;
@property(nonatomic, weak) IBOutlet UILabel *mainTextLabel;
@property(nonatomic, weak) IBOutlet UILabel *ctaLabel;
@property(nonatomic, weak) IBOutlet UILabel *sponsoredLabel;
@property(nonatomic, weak) IBOutlet UIImageView *mainImageView;
@property(nonatomic, weak) IBOutlet UIImageView *iconImageView;
@property(nonatomic, weak) IBOutlet UIImageView *privacyIconImageView;

@end

@implementation DemoMoPubNativeAdapterAdView

- (UILabel *)nativeMainTextLabel
{
    return self.mainTextLabel;
}

- (UILabel *)nativeTitleTextLabel
{
    return self.titleTextLabel;
}

- (UIImageView *)nativeIconImageView
{
    return self.iconImageView;
}

- (UIImageView *)nativeMainImageView
{
    return self.mainImageView;
}

- (UILabel *)nativeSponsoredByCompanyTextLabel
{
    return self.sponsoredLabel;
}


- (UILabel *)nativeCallToActionTextLabel
{
    return self.ctaLabel;
}

- (UIImageView *)nativePrivacyInformationIconImageView
{
    return self.privacyIconImageView;
}

+ (UINib *)nibForAd
{
    NSBundle *bundle = [NSBundle bundleForClass:[self class]];
    UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:bundle];
    return nib;
}

@end
