Skip to content

Instantly share code, notes, and snippets.

@armadsen
Created March 16, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armadsen/d6b7b68fc5e179db8462 to your computer and use it in GitHub Desktop.
Save armadsen/d6b7b68fc5e179db8462 to your computer and use it in GitHub Desktop.
-[EventCell drawRect] for CustomDesignedAgenda (DevMountain Lesson 25 - Custom Interfaces)
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
UIColor *color = [UIColor colorWithWhite:1.0 alpha:0.2];
[color setFill];
[color setStroke];
// Draw stripe on right
CGRect sideLineRect = CGRectMake(CGRectGetMidX(self.marker.frame) - 1.5,
CGRectGetMinY(self.bounds),
3.0,
CGRectGetHeight(self.bounds));
[[UIBezierPath bezierPathWithRect:sideLineRect] fill];
if (self.drawsSeparator) {
// Draw dotted line between cells
UIBezierPath *dottedLine = [UIBezierPath bezierPath];
dottedLine.lineWidth = 2.0;
[dottedLine setLineDash:(CGFloat []){3.0, 1.0} count:2 phase:0.0];
CGFloat leftX = CGRectGetMaxX(self.marker.frame) + 10.0;
CGFloat rightX = CGRectGetMaxX(self.bounds) - 10.0;
CGFloat bottomY = CGRectGetMaxY(self.bounds);
[dottedLine moveToPoint:CGPointMake(leftX, bottomY)];
[dottedLine addLineToPoint:CGPointMake(rightX, bottomY)];
[dottedLine stroke];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment