STTransition一个视图控制器(ViewController
)转场动画及交互的控制器。
- 内置了两个常用的动画:
STScaleZoomAnimation
STDirectionAnimation
- 一个常用的手势交互
STSwipeInteraction
并且可通过设置属性来调整需要
- 替代
UIViewController
的transitioningDelegate
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;
});
- 替代
UINavigationController
的delegate
nav.navigationTransition = STTransitionMake(^(STTransition *instance) {
instance.animationTransitioning = STDirectionAnimationMake(^(STDirectionAnimation *instance) {
// 纵向动画
instance.direction = STDirectionVertical;
});
instance.interactiveTransitioning = STSwipeInteractionMake(^(STSwipeInteraction *instance) {
// 纵向交互
instance.direction = STDirectionVertical;
});
});