UIView+Animation.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // UIView+Animation.h
  3. //
  4. //
  5. // Created by Jeans on 3/9/13.
  6. // Copyright (c) 2013 Jeans. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define kDefaultAnimateTime 0.25f
  10. typedef enum AnimateType{ //动画类型
  11. AnimateTypeOfTV, //电视
  12. AnimateTypeOfPopping, //弹性缩小放大
  13. AnimateTypeOfLeft, //左
  14. AnimateTypeOfRight, //右
  15. AnimateTypeOfTop, //上
  16. AnimateTypeOfBottom //下
  17. }AnimateType;
  18. @interface UIView (Animation)
  19. #pragma mark - 获取顶部View
  20. + (UIView *)getTopView;
  21. #pragma mark - 顶层maskView触摸
  22. + (void)setTopMaskViewCanTouch:(BOOL)_canTouch;
  23. /**
  24. 显示view
  25. @param _view 需要显示的view
  26. @param _aType 动画类型
  27. @param _fRect 最终位置
  28. */
  29. + (void)showView:(UIView*)_view animateType:(AnimateType)_aType finalRect:(CGRect)_fRect;
  30. /**
  31. 消失view
  32. */
  33. + (void)hideView;
  34. /**
  35. 消失view
  36. @param _aType 动画类型
  37. */
  38. + (void)hideViewByType:(AnimateType)_aType;
  39. #pragma mark - 下面的增加了完成块
  40. + (void)showView:(UIView*)_view animateType:(AnimateType)_aType finalRect:(CGRect)_fRect completion:(void(^)(BOOL finished))completion;
  41. + (void)hideViewByCompletion:(void(^)(BOOL finished))completion;
  42. + (void)hideViewByType:(AnimateType)_aType completion:(void(^)(BOOL finished))completion;
  43. @end