//
//  TaUtils.m
//  AdIOSSDK
//
//  Created by doulai on 12/7/16.
//  Copyright © 2016 Ta. All rights reserved.
//

#import "TaUtils.h"

@implementation TaUtils
+(void)addIconForView:(UIView*)parent paramter:(NSDictionary*)dic btn:(SEL )func caller:(UIView*)callself;
{
    UIButton *btn =[[UIButton alloc] initWithFrame:CGRectMake(parent.bounds.size.width-20, 0, 20, 20)];
    [btn setBackgroundImage:[UIImage imageNamed:@"TuiaAd.bundle/tuia_close"] forState:UIControlStateNormal];
    [btn addTarget:callself action:(func) forControlEvents:UIControlEventTouchUpInside];
    if ([[dic objectForKey:@"ad_close_visible"] integerValue]==1)
    [parent addSubview:btn];
    
    UIImageView*adview =[[UIImageView alloc] initWithFrame:CGRectMake(4, parent.bounds.size.height-17, 29, 15)];
    [adview setImage:[UIImage imageNamed:@"TuiaAd.bundle/tuia_icon"]];
    if ([[dic objectForKey:@"ad_icon_visible"] integerValue]==1)
        [parent addSubview:adview];
}

@end
