#import "BannerBaseViewController.h"

@interface BannerBaseViewController ()

@end

@implementation BannerBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.bannerView.constraints filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSLayoutConstraint*  _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
        return evaluatedObject.firstAttribute == NSLayoutAttributeWidth;
    }]].firstObject.constant = self.adSize.width;
    
    [self.bannerView.constraints filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSLayoutConstraint*  _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
        return evaluatedObject.firstAttribute == NSLayoutAttributeHeight;
    }]].firstObject.constant = self.adSize.height;
}

-(id)init {
    self = [super initWithNibName:@"BannerBaseViewController" bundle:nil];
    self.adSize = CGSizeMake(320, 50);
    return self;
}

-(id)initWithAdSize:(CGSize)adSize {
    self = [super initWithNibName:@"BannerBaseViewController" bundle:nil];
    self.adSize = adSize;
    return self;
}

@end
