Created
March 16, 2015 14:09
-
-
Save armadsen/d6b7b68fc5e179db8462 to your computer and use it in GitHub Desktop.
-[EventCell drawRect] for CustomDesignedAgenda (DevMountain Lesson 25 - Custom Interfaces)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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