Giter VIP home page Giter VIP logo

lcnavigationcontroller's Introduction

LCNavigationController

Travis CocoaPods CocoaPods CocoaPods LeoDev

除 UINavigationController 外最流行的 NavigationController!

by http://LeoDev.me

by http://LeoDev.me

In me the tiger sniffs the rose.

心有猛虎,细嗅蔷薇。

欢迎访问 我的博客http://LeoDev.me

前言 Foreword

效果参考 App:腾讯新闻、百度音乐等等

⚠️ 项目目前存在一些不足,表现在 viewController 层级相对较多时出现一些卡顿,我会抽空重新思考换一套实现方式,此前不建议集成到大型项目中!

配合UITabBarController使用请参考 tabbar 分支!

效果图:

by http://LeoDev.me

代码 Code

当成UINavigationController来用就行!方法都一样!

配合UITabBarController使用请参考 tabbar 分支!

  • 两种导入方法:

    • 方法一:CocoaPods 导入:pod 'LCNavigationController'
    • 方法二:导入LCNavigationController文件夹到你的项目中 (文件夹在 Demo 中可以找到)
  • AppDelegate.m中,#import "LCNavigationController.h",参考如下代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        [self.window makeKeyAndVisible];
    
        UIViewController *mainVC = [UIStoryboard storyboardWithName:@"Main" bundle:nil].instantiateInitialViewController;
    
        LCNavigationController *navC = [[LCNavigationController alloc] initWithRootViewController:mainVC];
    
        self.window.rootViewController = navC;
    
        return YES;
    }
  • 在你需要用到的地方#import "LCNavigationController.h",然后:

    // 1. Push
    UIViewController *childVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"TwoVC"];
    [self.lcNavigationController pushViewController:childVC];
    
    // 2. Pop
    [self.lcNavigationController popViewController];
    
    // 3. Pop to rootViewController
    [self.lcNavigationController popToRootViewController];
  • 可自定义的参数(在LCNavigationController.m中):

    static const CGFloat LCAnimationDuration = 0.50f;   // Push / Pop 动画持续时间
    
    static const CGFloat LCMaxBlackMaskAlpha = 0.80f;   // 黑色背景透明度
    
    static const CGFloat LCZoomRatio         = 0.90f;   // 后面视图缩放比
    
    static const CGFloat LCShadowOpacity     = 0.80f;   // 滑动返回时当前视图的阴影透明度
    
    static const CGFloat LCShadowRadius      = 8.00f;   // 滑动返回时当前视图的阴影半径
  • 搞定!

更新日志 Update Logs

V 1.0.6 2016.04.05

  • 更新 CocoaPods 源。

V 1.0.2 2015.11.24

  • 提供配合UITabBarController使用的 Demo,详见 tabbar 分支。

  • 更新自定义参数。

V 1.0.0 2015.11.20

  • 初始化提交。

联系 Support

授权 License

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

lcnavigationcontroller's People

Contributors

itofu avatar

Watchers

Harold Bierlein avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.