UIView+Category.m 435 B

123456789101112131415161718192021222324252627
  1. //
  2. // UIView+Category.m
  3. // MSYOUPAI
  4. //
  5. // Created by admin on 2022/3/2.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "UIView+Category.h"
  9. #import "YYKit.h"
  10. @implementation UIView (Category)
  11. // 设置圆角
  12. - (void)ms_radius:(CGFloat)radius{
  13. if (radius>0){
  14. self.layer.cornerRadius = radius;
  15. self.layer.masksToBounds = YES;
  16. }else{
  17. self.layer.cornerRadius = radius;
  18. self.layer.masksToBounds = NO;
  19. }
  20. }
  21. @end