Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Deprecated two methods
Browse files Browse the repository at this point in the history
lineColorForIndex & lineAlphaForIndex are now deprecated in preparation
of new update.
  • Loading branch information
Boris-Em committed May 19, 2014
1 parent a48640f commit ef139c3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
29 changes: 13 additions & 16 deletions Classes/BEMSimpleLineGraphView.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,22 +209,6 @@
- (void)lineGraphDidFinishLoading:(BEMSimpleLineGraphView *)graph;


//----- CUSTOMIZATION -----//


/** The color of the line at the given index. This is called for each line in the graph, every time an update is made.
@param graph The graph object requesting the line color.
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
@return The color of the line. Specifying nil will cause the line to use the color specifed for the graph. */
- (UIColor *)lineGraph:(BEMSimpleLineGraphView *)graph lineColorForIndex:(NSInteger)index;


/** The alpha of the line at the given index. This is called for each line in the graph, every time an update is made.
@param graph The graph object requesting the line alpha.
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
@return The alpha value of the line, between 0.0 and 1.0. Specifying nil will cause the line to use the alpha specifed for the graph. */
- (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph lineAlphaForIndex:(NSInteger)index;


//----- TOUCH EVENTS -----//

Expand Down Expand Up @@ -299,4 +283,17 @@



/** The color of the line at the given index. This is called for each line in the graph, every time an update is made.
@param graph The graph object requesting the line color.
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
@return The color of the line. Specifying nil will cause the line to use the color specifed for the graph. */
- (UIColor *)lineGraph:(BEMSimpleLineGraphView *)graph lineColorForIndex:(NSInteger)index __deprecated;


/** The alpha of the line at the given index. This is called for each line in the graph, every time an update is made.
@param graph The graph object requesting the line alpha.
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
@return The alpha value of the line, between 0.0 and 1.0. Specifying nil will cause the line to use the alpha specifed for the graph. */
- (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph lineAlphaForIndex:(NSInteger)index __deprecated;

@end
18 changes: 16 additions & 2 deletions Classes/BEMSimpleLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,25 @@ - (void)drawLines {
}
line.topColor = self.colorTop;
line.bottomColor = self.colorBottom;
if ([self.delegate respondsToSelector:@selector(lineGraph:lineColorForIndex:)]) line.color = [self.delegate lineGraph:self lineColorForIndex:i];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([self.delegate respondsToSelector:@selector(lineGraph:lineColorForIndex:)])
{
NSLog(@"[BEMSimpleLineGraph] DEPRECATION WARNING. The delegate method lineColorForIndex, is deprecated and will become unavailable in a future version. This feature will not be suported in a future version. Update your delegate method as soon as possible.");
line.color = [self.delegate lineGraph:self lineColorForIndex:i];
}
#pragma clang diagnostic pop
else line.color = self.colorLine;
line.topAlpha = self.alphaTop;
line.bottomAlpha = self.alphaBottom;
if ([self.delegate respondsToSelector:@selector(lineGraph:lineAlphaForIndex:)]) line.alpha = [self.delegate lineGraph:self lineAlphaForIndex:i];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([self.delegate respondsToSelector:@selector(lineGraph:lineAlphaForIndex:)])
{
NSLog(@"[BEMSimpleLineGraph] DEPRECATION WARNING. The delegate method lineAlphaForIndex, is deprecated and will become unavailable in a future version. This feature will not be suported in a future version. Update your delegate method as soon as possible.");
line.lineAlpha = [self.delegate lineGraph:self lineAlphaForIndex:i];
}
#pragma clang diagnostic pop
else line.lineAlpha = self.alphaLine;
line.lineWidth = self.widthLine;
line.bezierCurveIsEnabled = self.enableBezierCurve;
Expand Down
Binary file not shown.

0 comments on commit ef139c3

Please sign in to comment.