Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //// General Declarations
- CGContextRef context = UIGraphicsGetCurrentContext();
- //// Shadow Declarations
- UIColor* shadow = [UIColor blackColor];
- CGSize shadowOffset = CGSizeMake(0, -0);
- CGFloat shadowBlurRadius = 15;
- //// Rectangle Drawing
- rectanglePath = [UIBezierPath bezierPathWithRect: CGRectMake(8, 8, 44, 44)];
- CGContextSaveGState(context);
- CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadow.CGColor);
- [[UIColor whiteColor] setFill];
- [rectanglePath fill];
- CGContextRestoreGState(context);
- - (void)makeRed {
- NSLog(@"makeRed");
- CGContextRef context = UIGraphicsGetCurrentContext();
- // Shadow Declarations
- UIColor* shadow = [UIColor redColor];
- CGSize shadowOffset = CGSizeMake(0, -0);
- CGFloat shadowBlurRadius = 15;
- CGContextSaveGState(context);
- CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadow.CGColor);
- [[UIColor whiteColor] setFill];
- [rectanglePath fill];
- CGContextRestoreGState(context);
- }
- - (void)makeRed;
- {
- self.shadowColor = [UIColor redColor];
- [self setNeedsDisplay];
- }
- CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, self.shadowColor.CGColor);
Add Comment
Please, Sign In to add comment