// // 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)transitionContext { return 0.4; } - (void)animateTransition:(id)transitionContext { if (_isPresenting) { [self presentAnimateTransition:transitionContext]; }else { [self dismissAnimateTransition:transitionContext]; } } - (void)presentAnimateTransition:(id)transitionContext { } - (void)dismissAnimateTransition:(id)transitionContext { } @end