带小视频的引导图

使用方法:

附上库文件下载地址 https://git.oschina.net/19941225/VideoGuide.git

1、导入头文件

#import "XZMCoreNewFeatureVC.h"
#import "CALayer+Transition.h"

2、多张启动页

    UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

    

    self.window = window;

    

    //判断是否需要显示:(内部已经考虑版本及本地版本缓存)

    BOOL canShow = [XZMCoreNewFeatureVC canShowNewFeature];

    

    //测试代码,正式版本应该删除

    canShow = YES;

    

    if(canShow){ // 初始化新特性界面

        window.rootViewController = [XZMCoreNewFeatureVC newFeatureVCWithImageNames:@[@"new1",@"new2",@"new3",@"new4"] enterBlock:^{

            

            NSLog(@"进入主页面");

            [self enter];

            

        } configuration:^(UIButton *enterButton) { // 配置进入按钮

            [enterButton setBackgroundImage:[UIImage imageNamed:@"btn_nor"] forState:UIControlStateNormal];

            [enterButton setBackgroundImage:[UIImage imageNamed:@"btn_pressed"] forState:UIControlStateHighlighted];

            enterButton.bounds = CGRectMake(0, 0, 120, 40);

            enterButton.center = CGPointMake(KScreenW * 0.5, KScreenH* 0.85);

        }];

        

    }else{

        

        [self enter];

    }

    

    [window makeKeyAndVisible];

    

    return YES;

3、启动小视频

    UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

    

    self.window = window;

    

    //判断是否需要显示:(内部已经考虑版本及本地版本缓存)

    BOOL canShow = [XZMCoreNewFeatureVC canShowNewFeature];

    

    //测试代码,正式版本应该删除

    canShow = YES;

    

    if(canShow){ // 初始化新特性界面

        window.rootViewController = [XZMCoreNewFeatureVC newFeatureVCWithPlayerURL:[[NSBundle mainBundle] URLForResource:@"启动视频.mp4" withExtension:nil] enterBlock:^{

            

            NSLog(@"进入主页面");

            [self enter];

        } configuration:^(AVPlayerLayer *playerLayer) {

            

        }];

        

    }else{

        

        [self enter];

    }

    

    [window makeKeyAndVisible];

    

    return YES;

4、进入主页面

// 进入主页面

-(void)enter{

    

    UIViewController *vc = [[UIViewController alloc] init];

    vc.view.backgroundColor = [UIColor brownColor];

    self.window.rootViewController = vc;

    [self.window.layer transitionWithAnimType:TransitionAnimTypeRamdomsubType:TransitionSubtypesFromRamdom curve:TransitionCurveRamdom duration:2.0f];

}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容