2
0

XLPageViewControllerUtil.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // XLPageViewControllerUtil.h
  3. // XLPageViewControllerExample
  4. //
  5. // Created by MengXianLiang on 2019/5/8.
  6. // Copyright © 2019 xianliang meng. All rights reserved.
  7. // https://github.com/mengxianliang/XLPageViewController
  8. // 工具类
  9. #import <Foundation/Foundation.h>
  10. #import <UIKit/UIKit.h>
  11. #import "XLPageViewControllerConfig.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. //------------------------------CUT------------------------------
  14. @interface XLPageViewControllerUtil : NSObject
  15. //文字宽度
  16. + (CGFloat)widthForText:(NSString *)text font:(UIFont *)font size:(CGSize)size;
  17. //颜色过渡
  18. + (UIColor *)colorTransformFrom:(UIColor*)fromColor to:(UIColor *)toColor progress:(CGFloat)progress;
  19. //执行阴影动画
  20. + (void)showAnimationToShadow:(UIView *)shadow shadowWidth:(CGFloat)shadowWidth fromItemRect:(CGRect)fromItemRect toItemRect:(CGRect)toItemRect type:(XLPageShadowLineAnimationType)type progress:(CGFloat)progress;
  21. @end
  22. //------------------------------CUT------------------------------
  23. /**
  24. 兼容子view滚动,添加"让我先滚"属性
  25. */
  26. @interface UIView (LetMeScroll)
  27. /**
  28. 让我先滚 默认 NO
  29. */
  30. @property (nonatomic, assign) BOOL xl_letMeScrollFirst;
  31. @end
  32. //------------------------------CUT------------------------------
  33. /**
  34. 子视图控制器的缓存,添加扩展标题
  35. */
  36. @interface UIViewController (Title)
  37. /**
  38. 添加扩展标题
  39. */
  40. @property (nonatomic, copy) NSString *xl_title;
  41. @end
  42. //------------------------------CUT------------------------------
  43. typedef BOOL(^XLOtherGestureRecognizerBlock)(UIGestureRecognizer *otherGestureRecognizer);
  44. @interface UIScrollView (GestureRecognizer)<UIGestureRecognizerDelegate>
  45. @property (nonatomic, copy) XLOtherGestureRecognizerBlock xl_otherGestureRecognizerBlock;
  46. @end
  47. NS_ASSUME_NONNULL_END