JWLaunchAd 1.3.4

JWLaunchAd 1.3.4

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2016年9月

Yike 维护。



  • 作者
  • JWXIAN

   

示例项目

image image image

API

/**
 *  初始化启动页
 *
 *  @param adDuration  停留时间
 *  @param hideSkip    是否隐藏跳过
 *  @param setLaunchAd launchAdView
 *
 *  @return self
 */
+ (instancetype)initImageWithAttribute:(NSInteger)adDuration hideSkip:(BOOL)hideSkip setLaunchAd:(JWSetLaunchAdBlock)setLaunchAd;

/**
 *  设置图片
 *
 *  @param strURL       URL
 *  @param options      图片缓冲模式
 *  @param result       UIImage *image, NSURL *url
 *  @param adClickBlock 点击图片回调
 */
- (void)setWebImageWithURL:(NSString *)strURL options:(JWWebImageOptions)options result:(JWWebImageCompletionBlock)result adClickBlock:(JWLaunchAdClickBlock)adClickBlock;

/**
*  设置动画跳过属性
*
*  @param strokeColor     转动颜色
*  @param lineWidth       宽度
*  @param backgroundColor 背景色
*  @param textColor       字体颜色
*/
- (void)setAnimationSkipWithAttribute:(UIColor *)strokeColor lineWidth:(NSInteger)lineWidth backgroundColor:(UIColor *)backgroundColor textColor:(UIColor *)textColor;

/**
 *  广告图Frame
 */
@property (assign, nonatomic) CGRect launchAdViewFrame;

用法

  • 在 AppDelegate 中设置 Window.rootViewController 后调用下面方法
//  1.设置启动页广告图片的URL
NSString *imgUrlString =@"http://imgstore.cdn.sogou.com/app/a/100540002/714860.jpg";

//  2.初始化启动页
[JWLaunchAd initImageWithAttribute:6.0 showSkipType:SkipShowTypeAnimation setLaunchAd:^(JWLaunchAd *launchAd) {
    __block JWLaunchAd *weakSelf = launchAd;
    //如果选择 SkipShowTypeAnimation 需要设置动画跳过按钮的属性
    [weakSelf setAnimationSkipWithAttribute:[UIColor redColor] lineWidth:3.0 backgroundColor:nil textColor:nil];

    [launchAd setWebImageWithURL:imgUrlString options:JWWebImageDefault result:^(UIImage *image, NSURL *url) {

        //  异步缓冲图片完成后调整图片Frame
        weakSelf.launchAdViewFrame = CGRectMake(0, 0, kScreen_Width, kScreen_Height-100);
    } adClickBlock:^{

        //  3.广告回调  
        NSString *url = @"https://www.baidu.com";
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    }];
}];

安装

手动

  1. 将源文件添加到您的 Xcode 项目中。
  2. 导入 JWLaunchAd.h.

需求

此库需要 iOS 7.0+

许可证

JWLaunchAd 在 MIT 许可下提供。有关详细信息,请参阅 LICENSE 文件。