UIView+Category.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // UIView+Category.h
  3. // 乐销
  4. //
  5. // Created by 刘惠萍 on 2017/5/29.
  6. // Copyright © 2017年 ping. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIView (Category)<UIGestureRecognizerDelegate>
  10. @property (nonatomic, assign,readonly) BOOL isEdited;
  11. //获取第一响应者
  12. - (UIView *)fetchFirstResponder;
  13. //获取所在vc
  14. - (UIViewController *)fetchVC;
  15. //移除全部视图
  16. - (void)removeAllSubViews;
  17. //增加顶部高度
  18. - (void)addSubViewsTopHeight:(CGFloat)height;
  19. // 移除视图 根据tag
  20. - (void)removeSubViewWithTag:(NSInteger)tag;
  21. //获取子视图 根据tag
  22. - (NSArray *)fetchSubViewsWithTag:(NSInteger)tag;
  23. //添加线
  24. - (CGFloat)addLineFrame:(CGRect)rect;
  25. - (CGFloat)addLineFrame:(CGRect)rect tag:(NSInteger)tag;
  26. - (CGFloat)addLineFrame:(CGRect)rect color:(UIColor *)color;
  27. - (CGFloat)addLineWithHeight:(CGFloat)height;
  28. //获取线视图
  29. + (UIView *)lineWithFrame:(CGRect)rect color:(UIColor *)color;
  30. + (UIView *)lineWithHeight:(CGFloat)height;
  31. + (UIView *)lineWithHeight:(CGFloat)height backGroundColor:(UIColor *)color;
  32. //增加点击事件
  33. - (void)addTarget:(id)target action:(SEL)action;
  34. - (void)addKeyboardHideGesture;
  35. - (void)addShadowToView:(UIView *)theView withColor:(UIColor *)theColor;
  36. @end