Skip to content

Commit

Permalink
Added assert check for line width and added hookups to demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry Worona committed Mar 3, 2014
1 parent 47c6d74 commit 09fefa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/JBLineChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ - (void)drawRect:(CGRect)rect
}

NSAssert([self.delegate respondsToSelector:@selector(lineColorForLineChartLineView:)], @"JBLineChartLineView // delegate must implement - (UIColor *)lineColorForLineChartLineView:(JBLineChartLineView*)lineChartLineView");
NSAssert([self.delegate respondsToSelector:@selector(lineWidthForLineChartLineView:)], @"JBLineChartLineView // delegate must implement - (UIColor *)lineWidthForLineChartLineView:(JBLineChartLineView*)lineChartLineView");

if (self.shapeLayer == nil)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
CGFloat const kJBLineChartViewControllerChartHeaderHeight = 75.0f;
CGFloat const kJBLineChartViewControllerChartHeaderPadding = 20.0f;
CGFloat const kJBLineChartViewControllerChartFooterHeight = 20.0f;
CGFloat const kJBLineChartViewControllerChartLineWidth = 6.0f;
NSInteger const kJBLineChartViewControllerNumChartPoints = 27;

// Strings
Expand Down Expand Up @@ -159,6 +160,11 @@ - (UIColor *)lineColorForLineChartView:(JBLineChartView *)lineChartView
return kJBColorLineChartLineColor;
}

- (CGFloat)lineWidthForLineChartView:(JBLineChartView *)lineChartView
{
return kJBLineChartViewControllerChartLineWidth;
}

- (UIColor *)selectionColorForLineChartView:(JBLineChartView *)lineChartView
{
return [UIColor whiteColor];
Expand Down

0 comments on commit 09fefa2

Please sign in to comment.