Skip to content

一行代码集成启动页广告,不依赖任何第三方,支持Gif,自带图片下载缓冲,无负担集成。

License

Notifications You must be signed in to change notification settings

wangchuangchuang/JWLaunchAd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image Support AppVeyor Bintray

-- image image

-- 集成步骤:

  • 1.设置项目启动页为LaunchImage 设置方法:在Assets.xcassets中新建LaunchImage
    在项目中设置Launch Images Source,并将Launch Screen File清空 image

  • 2.在LaunchImage 添加相应启动图片
    image

  • 3.在AppDelegate中设置window.rootViewController之后调用下面方法

    //  1.设置启动页广告图片的url
     NSString *imgUrlString =@"http://imgstore.cdn.sogou.com/app/a/100540002/714860.jpg";
    
    //  2.初始化启动页广告(初始化后,自动添加至视图,不用手动添加)
    [JWLaunchAd initImageWithAttribute:10.0 hideSkip:NO setLaunchAd:^(JWLaunchAd *launchAd) {
        __block JWLaunchAd *weakSelf = launchAd;
        [launchAd setWebImageWithURL:imgUrlString options:JWWebImageDefault result:^(UIImage *image, NSURL *url) {

            //  异步加载图片完成回调(可以调整图片尺寸)
            weakSelf.adFrame = CGRectMake(0, 0, kScreen_Width, kScreen_Height-150);
        } adClickBlock:^{

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

About

一行代码集成启动页广告,不依赖任何第三方,支持Gif,自带图片下载缓冲,无负担集成。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%