UIView+Visualization.m 769 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // UIView+Visualization.m
  3. // HCQuanfangtong
  4. //
  5. // Created by Apple on 2019/5/8.
  6. // Copyright © 2019 qft_Ios_03. All rights reserved.
  7. //
  8. #import "UIView+Visualization.h"
  9. @implementation UIView (Visualization)
  10. - (void)setCornerRadius:(CGFloat)cornerRadius {
  11. self.layer.cornerRadius = cornerRadius;
  12. }
  13. - (CGFloat)cornerRadius {
  14. return self.layer.cornerRadius;
  15. }
  16. - (void)setBorderWidth:(CGFloat)borderWidth {
  17. self.layer.borderWidth = borderWidth;
  18. }
  19. - (CGFloat)borderWidth {
  20. return self.layer.borderWidth;
  21. }
  22. - (void)setBorderColor:(UIColor *)borderColor {
  23. self.layer.borderColor = borderColor.CGColor;
  24. }
  25. - (UIColor *)borderColor {
  26. CGColorRef colorRef = self.layer.borderColor;
  27. return [UIColor colorWithCGColor:colorRef];;
  28. }
  29. @end