Giter Club home page Giter Club logo

cctransition's Introduction

CCTransition 快速自定义转场动画

Pod Version Pod Platform Pod License Support 

###截图

Drawing

开始(Getting started)

  • 使用 cocopods ( Using CocoaPods)

      pod 'CCTransition', '~> 1.0.0'
    
  • 常规使用 (Using narmal)

    将 CCTransition 文件夹拖入项目

Basic usage

  1. 自定义导航控制器转场

创建一个 CCNavigationController 实例 给控制器设置一种转场类型

    CCNavigationController *navigationController = [[CCNavigationController alloc] initWithRootViewController:viewController];

    CCLayerAnimation *layerAnimation = [[CCLayerAnimation alloc] initWithType:CCLayerAnimationCover];
    navigationController.animationController = layerAnimation;

如果你是用 storyBord, 请确保你的控制器被 CCNavigationController管理

  • 使用方法, 你可以在 viewDidLoad 添加以下代码
    //初始化控制器
   CCNavigationController *fancyNavigationController = (CCNavigationController *)self.navigationController;
   //初始化动画效果
   CCLayerAnimation *layerAnimation = [[CCLayerAnimation alloc] initWithType:CCLayerAnimationCover];
   //设置动画效果
   fancyNavigationController.animationController = layerAnimation;
  1. 自定义 Modal 转场

确保你用来 modal 的控制器是 CCViewController 的子类

  //初始化用来 modal 操作控制器   一般是 self 
   CCMainViewController *mainController = [[CCMainViewController alloc] initWithNibName:@"CCMainViewController" bundle:nil];
    //初始化动画效果
   CCSlideAnimation *slideAnimation = [[CCSlideAnimation alloc] init];
   slideAnimation.type = CCSlideAnimationFromTop;
   //设置动画效果
   mainController.animationController = slideAnimation;


  //初始化被 Modal 出的控制器
   CCModalViewController *modalController = [[CCModalViewController alloc] initWithNibName:@"CCModalViewController" bundle:nil];
   //设置代理
   modalController.transitioningDelegate = mainController.transitioningDelegate;
   
   //进行 Modal 操作
   [modalController.navigationController presentViewController:viewController animated:YES completion:nil];
  1. 交互
   
   navigationController.interactionEnabled = YES;

   
   mainViewController.interactionEnabled = YES;

cctransition's People

Contributors

xiongcaichang avatar

Watchers

 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.