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

Commit ef139c3

Browse files
committed
Deprecated two methods
lineColorForIndex & lineAlphaForIndex are now deprecated in preparation of new update.
1 parent a48640f commit ef139c3

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

Classes/BEMSimpleLineGraphView.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,6 @@
209209
- (void)lineGraphDidFinishLoading:(BEMSimpleLineGraphView *)graph;
210210

211211

212-
//----- CUSTOMIZATION -----//
213-
214-
215-
/** The color of the line at the given index. This is called for each line in the graph, every time an update is made.
216-
@param graph The graph object requesting the line color.
217-
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
218-
@return The color of the line. Specifying nil will cause the line to use the color specifed for the graph. */
219-
- (UIColor *)lineGraph:(BEMSimpleLineGraphView *)graph lineColorForIndex:(NSInteger)index;
220-
221-
222-
/** The alpha of the line at the given index. This is called for each line in the graph, every time an update is made.
223-
@param graph The graph object requesting the line alpha.
224-
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
225-
@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. */
226-
- (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph lineAlphaForIndex:(NSInteger)index;
227-
228212

229213
//----- TOUCH EVENTS -----//
230214

@@ -299,4 +283,17 @@
299283

300284

301285

286+
/** The color of the line at the given index. This is called for each line in the graph, every time an update is made.
287+
@param graph The graph object requesting the line color.
288+
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
289+
@return The color of the line. Specifying nil will cause the line to use the color specifed for the graph. */
290+
- (UIColor *)lineGraph:(BEMSimpleLineGraphView *)graph lineColorForIndex:(NSInteger)index __deprecated;
291+
292+
293+
/** The alpha of the line at the given index. This is called for each line in the graph, every time an update is made.
294+
@param graph The graph object requesting the line alpha.
295+
@param index The index from left to right of a given point (X-axis). The first value for the index is 0.
296+
@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. */
297+
- (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph lineAlphaForIndex:(NSInteger)index __deprecated;
298+
302299
@end

Classes/BEMSimpleLineGraphView.m

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,25 @@ - (void)drawLines {
330330
}
331331
line.topColor = self.colorTop;
332332
line.bottomColor = self.colorBottom;
333-
if ([self.delegate respondsToSelector:@selector(lineGraph:lineColorForIndex:)]) line.color = [self.delegate lineGraph:self lineColorForIndex:i];
333+
#pragma clang diagnostic push
334+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
335+
if ([self.delegate respondsToSelector:@selector(lineGraph:lineColorForIndex:)])
336+
{
337+
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.");
338+
line.color = [self.delegate lineGraph:self lineColorForIndex:i];
339+
}
340+
#pragma clang diagnostic pop
334341
else line.color = self.colorLine;
335342
line.topAlpha = self.alphaTop;
336343
line.bottomAlpha = self.alphaBottom;
337-
if ([self.delegate respondsToSelector:@selector(lineGraph:lineAlphaForIndex:)]) line.alpha = [self.delegate lineGraph:self lineAlphaForIndex:i];
344+
#pragma clang diagnostic push
345+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
346+
if ([self.delegate respondsToSelector:@selector(lineGraph:lineAlphaForIndex:)])
347+
{
348+
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.");
349+
line.lineAlpha = [self.delegate lineGraph:self lineAlphaForIndex:i];
350+
}
351+
#pragma clang diagnostic pop
338352
else line.lineAlpha = self.alphaLine;
339353
line.lineWidth = self.widthLine;
340354
line.bezierCurveIsEnabled = self.enableBezierCurve;

0 commit comments

Comments
 (0)