CPDFClipView.m 506 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // CPDFClipView.m
  3. // PDFViewer
  4. //
  5. // Created by kdanmobile_2 on 2022/12/23.
  6. //
  7. #import "CPDFClipView.h"
  8. @implementation CPDFClipView
  9. - (instancetype)initWithFrame:(CGRect)frame {
  10. self = [super initWithFrame:frame];
  11. if (self) {
  12. self.backgroundColor = [UIColor clearColor];
  13. }
  14. return self;
  15. }
  16. - (void)drawRect:(CGRect)rect {
  17. [super drawRect:rect];
  18. CGContextRef context = UIGraphicsGetCurrentContext();
  19. [self.delegate clipText:context];
  20. }
  21. @end