Skip to content

zhenlintie/STTransitionDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STTransition

说明

STTransition一个视图控制器(ViewController)转场动画交互的控制器。

  • 内置了两个常用的动画:
    1. STScaleZoomAnimation
    2. STDirectionAnimation
  • 一个常用的手势交互
    1. STSwipeInteraction

并且可通过设置属性来调整需要

主要用法

  1. 替代UIViewControllertransitioningDelegate
vc.transition = STTransitionMake(^(STTransition *instance) {
			 // 动画
            instance.animationTransitioning = STScaleZoomAnimationMake(^(STScaleZoomAnimation *instance) {
            instance.fromRect = ^CGRect(){
                return CGRectMake(20, 20, 100, 100);
            };
        });
       	    // 交互
        	instance.interactiveTransitioning = STSwipeInteractionMake(^(STSwipeInteraction *instance) {
        	   // 交互方向
         	   instance.direction = STDirectionHorizontal;
         	   // 交互方向反转
            	instance.reverse = YES;
        	});
  1. 替代UINavigationControllerdelegate
nav.navigationTransition = STTransitionMake(^(STTransition *instance) {
            instance.animationTransitioning = STDirectionAnimationMake(^(STDirectionAnimation *instance) {
                // 纵向动画
                instance.direction = STDirectionVertical;
            });
            instance.interactiveTransitioning = STSwipeInteractionMake(^(STSwipeInteraction *instance) {
                // 纵向交互
                instance.direction = STDirectionVertical;
            });
        });

	

截图

About

视图控制器场景切换,可自定义动画。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published