Skip to content

Instantly share code, notes, and snippets.

- (void)drawRect:(CPRect)aRect
{
var context = [[CPGraphicsContext currentContext] graphicsPort];
CGContextSetFillColor(context, @"#EEE");// [CPColor lightGrayColor]);
CGContextSetShadowWithColor(context, CGSizeMake(-5, 10), 5, [CPColor blackColor]);
var X_OFFSET = 78, Y_OFFSET = 18, BUBBLE_WIDTH = 310, BUBBLE_HEIGHT = 82, CORNER_RADIUS = 6;
var roundedRectPath = CGPathWithRoundedRectangleInRect(CGRectMake(X_OFFSET, Y_OFFSET, BUBBLE_WIDTH, BUBBLE_HEIGHT), CORNER_RADIUS, CORNER_RADIUS, YES, YES, YES, NO);
CGPathMoveToPoint(roundedRectPath, nil, X_OFFSET, Y_OFFSET);
CGPathAddLineToPoint(roundedRectPath, nil, X_OFFSET - 10, Y_OFFSET + 10);