GYIntroductionView 1.0.2

GYIntroductionView 1.0.2

maltsugar 维护。



  • zgy

GYIntroductionView

  CocoaPods 

English

App 启动引导页 新特性介绍,App 启动引导页面 介绍新功能

App 启动介绍页

在网上搜索了一些轮子,但觉得不太好用,灵活度不高,所以写了这个支持任意自定义的。我一直认为,参考市场上 APP 的效果,也无法完全模仿。所以写一些工具类时,最重要的原则就是能够灵活自定义,将具体的实现交给开发者,让他们根据自己的想法来实现。像我另外两个库(RollingNotice,CustomPopoverView),也秉持这一原则。以后在做小组件时,也会尽可能以这个原则作为首要标准,这样才算是一个“贴心”的库。

版本记录

  • 1.0.1 修复#1,修复iPhone X,只有前景图时,滑动残影的bug

这款启动视图,首先模仿几个特别典型的效果,至于没有的效果,完全交给你自由发挥了😬

素材和视频背景播放的方式来自ZWIntroductionViewController,感谢作者。

用法

  • 手动下载,将GYIntroductionView拖进项目
  • Cocoapods: pod 'GYIntroductionView'

普通用法

	NSArray *coverImageNames = @[@"img_index_01txt", @"img_index_02txt", @"img_index_03txt"];
    NSArray *backgroundImageNames = @[@"img_index_01bg", @"img_index_02bg", @"img_index_03bg"];
    
    GYIntroductionView *introductionView = [[GYIntroductionView alloc] initWithImgNames:coverImageNames bgImgNames:backgroundImageNames];
    [self.window addSubview:introductionView];
    _introductionView = introductionView;
    
    // enterButton and it's action
    // 进入按钮和进入按钮的回调
    UIButton *enterBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    enterBtn.bounds = CGRectMake(0, 0, 200, 60);
    enterBtn.center = CGPointMake(self.window.center.x, CGRectGetMaxY(self.window.frame) - 160);
    enterBtn.backgroundColor = [UIColor redColor];
    [enterBtn setTitle:@"立即进入" forState:UIControlStateNormal];
    introductionView.enterButton = enterBtn;
    
    [introductionView setEnterBlock:^{
        NSLog(@"block 点击进入");
    }];
    
    introductionView.delegate = self;
    

自定义

	_imgNames = @[@"img_index_01bg", @"img_index_02bg", @"img_index_03bg"];
    
    GYIntroductionView *introductionView = [[GYIntroductionView alloc] initWithImgCount:_imgNames.count andDataSource:self];
    introductionView.pageControl.frame = CGRectMake(0, 0, 100, 50);
    
    // ⚠️⚠️DO NOT forget to register your cell with intrrolCollectionView⚠️⚠️
    [introductionView.introlCollectionView registerNib:[UINib nibWithNibName:@"CustomIntroductionCell" bundle:nil] forCellWithReuseIdentifier:@"CustomIntroductionCell"];
    
    [self.window addSubview:introductionView];
    _introductionView = introductionView;

demo