A-A+

LSLaunchAD – 一行代码实现启动广告页

2016年08月29日 视图效果(View Effects) 暂无评论 阅读 1,586 views 次

LSLaunchAD - 一行代码实现启动广告页

 

一行代码实现启动广告页

 

实用方法


-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[LSLaunchAD showWithWindow:self.window
countTime:5
showCountTimeOfButton:YES
showSkipButton:YES
isFullScreenAD:NO
localAdImgName:nil
imageURL:@"http://img4q.duitang.com/uploads/item/201204/01/20120401222504_xMBAS.thumb.224_0.jpeg"
canClickAD:YES
aDBlock:^(BOOL clickAD) {
if (clickAD) {
NSLog(@"点击了广告");
UINavigationController *nav =
(UINavigationController *)
self.window.rootViewController;
UIViewController *vc = [[UIViewController alloc] init];
vc.view.backgroundColor = [UIColor whiteColor];
vc.title = @"广告";
[nav pushViewController:vc animated:YES];
} else {
NSLog(@"完成倒计时或点击了跳转按钮");
}
}];
return YES;

 

}

 

 

Githubhttps://github.com/lsmakethebest/LSLaunchAD

 

ad

给我留言

Copyright © iOSCodeHub 保留所有权利.  

用户登录 ⁄ 注册

分享到: