Guest User

Untitled

a guest
Jan 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. //// General Declarations
  2. CGContextRef context = UIGraphicsGetCurrentContext();
  3.  
  4. //// Shadow Declarations
  5. UIColor* shadow = [UIColor blackColor];
  6. CGSize shadowOffset = CGSizeMake(0, -0);
  7. CGFloat shadowBlurRadius = 15;
  8.  
  9.  
  10. //// Rectangle Drawing
  11. rectanglePath = [UIBezierPath bezierPathWithRect: CGRectMake(8, 8, 44, 44)];
  12. CGContextSaveGState(context);
  13. CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadow.CGColor);
  14. [[UIColor whiteColor] setFill];
  15. [rectanglePath fill];
  16. CGContextRestoreGState(context);
  17.  
  18. - (void)makeRed {
  19. NSLog(@"makeRed");
  20. CGContextRef context = UIGraphicsGetCurrentContext();
  21. // Shadow Declarations
  22. UIColor* shadow = [UIColor redColor];
  23. CGSize shadowOffset = CGSizeMake(0, -0);
  24. CGFloat shadowBlurRadius = 15;
  25. CGContextSaveGState(context);
  26. CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadow.CGColor);
  27. [[UIColor whiteColor] setFill];
  28. [rectanglePath fill];
  29. CGContextRestoreGState(context);
  30. }
  31.  
  32. - (void)makeRed;
  33. {
  34. self.shadowColor = [UIColor redColor];
  35. [self setNeedsDisplay];
  36. }
  37.  
  38. CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, self.shadowColor.CGColor);
Add Comment
Please, Sign In to add comment