All Projects → iTofu → Lcnewfeature

iTofu / Lcnewfeature

Licence: mit
几行代码快速集成新特性界面!

Projects that are alternatives of or similar to Lcnewfeature

Cocoapods Tips
iOS 라이브러리를 관리하는 CocoaPods Tip정보 모음입니다.
Stars: ✭ 141 (+29.36%)
Mutual labels:  guide, cocoapods
Pincodeinputview
A input text view for entering pin code.
Stars: ✭ 108 (-0.92%)
Mutual labels:  cocoapods
Go Compression.github.io
The Hitchhiker's Guide to Compression
Stars: ✭ 106 (-2.75%)
Mutual labels:  guide
Bblocationmanager
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.
Stars: ✭ 107 (-1.83%)
Mutual labels:  cocoapods
Numpy Cn
NumPy官方中文文档(完整版)
Stars: ✭ 1,570 (+1340.37%)
Mutual labels:  guide
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+9722.02%)
Mutual labels:  cocoapods
Build and test examples
Examples of build scripts and unit test frameworks for various languages, and how these can be used with the Jenkins continuous integration server. Contact: @mikej888
Stars: ✭ 104 (-4.59%)
Mutual labels:  guide
Materialactivityindicator
Material Activity Indicator
Stars: ✭ 109 (+0%)
Mutual labels:  cocoapods
Pyspark Cheatsheet
🐍 Quick reference guide to common patterns & functions in PySpark.
Stars: ✭ 108 (-0.92%)
Mutual labels:  guide
Appdevkit
AppDevKit is an iOS development library that provides developers with useful features to fulfill their everyday iOS app development needs.
Stars: ✭ 1,426 (+1208.26%)
Mutual labels:  cocoapods
Nextgrowingtextview
📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.
Stars: ✭ 1,540 (+1312.84%)
Mutual labels:  cocoapods
Ihequalizerview
An Custom UIView which draws the output of an audio asset in real time.
Stars: ✭ 106 (-2.75%)
Mutual labels:  cocoapods
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+9102.75%)
Mutual labels:  cocoapods
Node Playbook
Get started fast with Node.js
Stars: ✭ 1,402 (+1186.24%)
Mutual labels:  guide
Noviceguide
Android无侵入式引导提示 【博客地址:https://www.jianshu.com/p/94b73f314ab8】
Stars: ✭ 109 (+0%)
Mutual labels:  guide
Ccnpreferenceswindowcontroller
CCNPreferencesWindowController is an Objective-C subclass of NSWindowController that automatically manages your custom view controllers for handling app preferences.
Stars: ✭ 105 (-3.67%)
Mutual labels:  cocoapods
Pocketsvg
Easily convert your SVG files into CGPaths, CAShapeLayers, and UIBezierPaths
Stars: ✭ 1,483 (+1260.55%)
Mutual labels:  cocoapods
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+8917.43%)
Mutual labels:  cocoapods
Angular To React Redux
Angular to React/Redux, a Guide for Angular v1 Experts Looking to Learn React/Redux
Stars: ✭ 109 (+0%)
Mutual labels:  guide
Bitcoin Programming With Bitcoinjs
Bitcoin Programming with BitcoinJS, Bitcoin Core and LND
Stars: ✭ 109 (+0%)
Mutual labels:  guide

LCNewFeature

Travis CocoaPods CocoaPods CocoaPods LeoDev

几行代码快速集成新特性界面!

LCNewFeature

In me the tiger sniffs the rose.

心有猛虎,细嗅蔷薇。

欢迎访问 我的博客 ~

前言 Foreword

每次拿到一个项目的时候,头疼的几件事之一就是新特性界面,写一堆代码做一个简单的东西。所以抽空写了个快速集成新特性界面的框架,传了上来共享之~

代码 Code

  • 下面是示例代码,请多参考Demo!!

  • 两种集成方法任选一:

    • 方法一:CocoaPods 导入:pod 'LCNewFeature'
    • 方法二:在Demo中找到 LCNewFeature 文件夹,拖拽到你的项目中。
  • AppDelegate.m 文件中,导入头文件:#import "LCNewFeature.h",参考下列代码快速集成:

    BOOL showNewFeature = [LCNewFeatureVC shouldShowNewFeature];
    
    if (showNewFeature) {   // 如果需要显示新特性界面
    
        __weak typeof(self) weakSelf = self;
        LCNewFeatureVC *newFeatureVC = [LCNewFeatureVC newFeatureWithImageName:@"new_feature"
                                                                    imageCount:3
                                                                showPageControl:YES
                                                                    finishBlock:^{
    
                                                                        [weakSelf enterMainVC];
                                                                    }];
    
        self.window.rootViewController = newFeatureVC;
    
    } else {    // 如果不需要显示新特性界面
    
        [self enterMainVC];
    }
    
  • enterMainVC (进入主界面) 方法参考:

    - (void)enterMainVC {
    
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    
        self.window.rootViewController = storyboard.instantiateInitialViewController;
    }
    
  • 回调当前页码的 delegate:(@optional)

    // 当前页码的代理
    newFeatureVC.delegate = self;
    
    // ...
    
    #pragma mark - LCNewFeatureVC Delegate
    
    - (void)newFeatureVC:(LCNewFeatureVC *)newFeatureVC page:(NSInteger)page {
        NSLog(@"%@ -> Page: %d", newFeatureVC, (int)page);
    }
    
  • 有一些神奇的地方,比如赋值只需要传一次图片名是为什么?其实是这样的,你需要按以下规范来给图片命名:(这其实是美工的事:))

    比如图片原名:`[email protected]`
    
    规范:
    `[email protected]`   将作为第一张图展示
    `[email protected]`   将作为第二张图展示
    ...
    
  • 那么怎么适配不同尺寸的屏幕呢?简单,不用动代码,还是规范图片命名:(这还是美工的事:))

    比如图片原名:`[email protected]`
    
    规范:
    `[email protected]`           将展示在 iPhone 4 / 4s 上
    `[email protected]`   将展示在 iPhone 5 / 5s 上
    `[email protected]`   将展示在 iPhone 6 / 6s 上
    `[email protected]`  将展示在 iPhone 6 p / 6s p 上
    

版本 Release

V 1.1.3 (2016.05.03)

  • 去除 Log。

V 1.1.2 (2016.04.22)

  • 添加代理协议,回调当前页码。详见 Issue 5

V 1.1.1 (2016.04.05)

  • 更新 CocoaPods 源地址。

V 1.1.0 (2016.03.23)

  • 添加跳过按钮。

    __weak typeof(self) weakSelf = self;
    
    newFeatureVC.showSkip = YES;
    newFeatureVC.skipBlock = ^(void) {
        [weakSelf enterMainVC]; // 进入首页
    };
    

V 1.0.3 (2015.12.07)

  • Demo 中添加演示:切换 RootVC 时,如何搞淡入淡出效果。😈😈

V 1.0.3 (2015.11.13)

  • 添加对 iPhone 6 / 6s / 6 p / 6s p 的放大模式的支持,感谢 RobinChao 等同学的提醒。

  • 已针对放大模式进行了显示测试和边框校对,例:Demo 中的 iPhone 6 / 6s 第一张启动图。(根目录下有个 PSD 文件,参考修改)附:放大模式下屏幕分辨率:

    • iPhone 6 / 6s 的放大模式下,屏幕分辨率为:640 x 1136 (框架将使用 iPhone 5 的图)
    • iPhone 6 p / 6s p 的放大模式下,屏幕分辨率为:1125 x 2001 (框架将使用 iPhone 6 p 的图)

V 1.0.2 (2015.11.09)

  • 添加对 CocoaPods 的支持:pod 'LCNewFeature'

V 1.0.0 (2015.05.05)

  • 初始化提交。

  • 添加一些界面跳转的动画效果。

提示 Tips

  • 提供了两种进入主界面的方式:

    + (instancetype)newFeatureWithImageName:(NSString *)imageName imageCount:(NSInteger)imageCount showPageControl:(BOOL)showPageControl finishBlock:(finishBlock)finishBlock;
        将通过一直左划的方式,通过block回调进入主界面。
    + (instancetype)newFeatureWithImageName:(NSString *)imageName imageCount:(NSInteger)imageCount showPageControl:(BOOL)showPageControl enterButton:(UIButton *)enterButton;
        将在最后一张新特性图片上添加一个按钮,然后点击按钮进入主界面,按钮的属性设置好再传入(参考Demo中的代码)。
    
  • 上述方法都是类方法,也提供了实例方法 initWith... 什么的,视个人习惯调用。

  • 提供了一些属性,可选设置:

    • 当前点(分页控制器)的颜色:pointCurrentColor
    • 其他点(分页控制器)的颜色:pointOtherColor
    • 状态栏样式:statusBarStyle
  • 记住一句话:经理可以顶,职位可以辞,但是服务器的哥们和美工的妹子绝对不能惹!2333

  • 多参考 Demo,如果还有问题或者建议,请联系我,我也想做的更好!联系方式在下面:)

联系 Support

授权 License

本项目采用 MIT license 开源,你可以利用采用该协议的代码做任何事情,只需要继续继承 MIT 协议即可。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].