PCSRoundButton.m 884 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // PCSRoundButton.m
  3. // sampleSDK
  4. //
  5. // Created by 王昭威 on 2023/1/14.
  6. //
  7. #import "PCSRoundButton.h"
  8. #import <Masonry/Masonry.h>
  9. @implementation PCSRoundButton
  10. - (void)awakeFromNib{
  11. [super awakeFromNib];
  12. self.titleLabel.alpha = 0;
  13. }
  14. - (void)layoutSubviews{
  15. [super layoutSubviews];
  16. CGRect bounds = self.layer.bounds;
  17. bounds.size.height = bounds.size.width;
  18. self.layer.bounds = bounds;
  19. self.layer.cornerRadius = CGRectGetHeight(self.bounds) * 0.5;
  20. }
  21. - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
  22. {
  23. return YES;
  24. }
  25. /*
  26. // Only override drawRect: if you perform custom drawing.
  27. // An empty implementation adversely affects performance during animation.
  28. - (void)drawRect:(CGRect)rect {
  29. // Drawing code
  30. }
  31. */
  32. @end