diff --git a/Classes/BEMSimpleLineGraphView.h b/Classes/BEMSimpleLineGraphView.h index 0506d07..37d6951 100644 --- a/Classes/BEMSimpleLineGraphView.h +++ b/Classes/BEMSimpleLineGraphView.h @@ -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 -----// @@ -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 diff --git a/Classes/BEMSimpleLineGraphView.m b/Classes/BEMSimpleLineGraphView.m index 3386881..3cc70f7 100644 --- a/Classes/BEMSimpleLineGraphView.m +++ b/Classes/BEMSimpleLineGraphView.m @@ -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; diff --git a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate index 4213966..eba66d6 100644 Binary files a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate and b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate differ