12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //
- // TYBaseAnimation.m
- // TYAlertControllerDemo
- //
- // Created by SunYong on 15/9/1.
- // Copyright (c) 2015年 tanyang. All rights reserved.
- //
- #import "TYBaseAnimation.h"
- @interface TYBaseAnimation ()
- @property (nonatomic, assign) BOOL isPresenting;
- @end
- @implementation TYBaseAnimation
- - (instancetype)initWithIsPresenting:(BOOL)isPresenting
- {
- if (self = [super init]) {
- self.isPresenting = isPresenting;
- }
- return self;
- }
- + (instancetype)alertAnimationIsPresenting:(BOOL)isPresenting
- {
- return [[self alloc]initWithIsPresenting:isPresenting];
- }
- + (instancetype)alertAnimationIsPresenting:(BOOL)isPresenting preferredStyle:(TYAlertControllerStyle)preferredStyle
- {
- return [[self alloc]initWithIsPresenting:isPresenting];
- }
- // override this moethod
- - (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
- {
- return 0.4;
- }
- - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
- {
- if (_isPresenting) {
- [self presentAnimateTransition:transitionContext];
- }else {
- [self dismissAnimateTransition:transitionContext];
- }
- }
- - (void)presentAnimateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
- {
-
- }
- - (void)dismissAnimateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
- {
-
- }
- @end
|