diff --git a/Classes/Base/JBChartView.h b/Classes/Base/JBChartView.h index 6fa941071..b20105e48 100644 --- a/Classes/Base/JBChartView.h +++ b/Classes/Base/JBChartView.h @@ -132,7 +132,7 @@ typedef NS_ENUM(NSInteger, JBChartViewState){ * @param force If current state == new state, then setting force to YES will re-configure the chart (default NO). * @param callback Called once the animation is completed. If animated == NO, then callback is immediate. */ -- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)())callback; +- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)(void))callback; /** * State setter. @@ -141,7 +141,7 @@ typedef NS_ENUM(NSInteger, JBChartViewState){ * @param animated Whether or not the state should be animated or not. * @param callback Called once the animation is completed. If animated == NO, then callback is immediate. */ -- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback; +- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)(void))callback; /** * State setter. diff --git a/Classes/Base/JBChartView.m b/Classes/Base/JBChartView.m index 2515475bd..c764b957c 100644 --- a/Classes/Base/JBChartView.m +++ b/Classes/Base/JBChartView.m @@ -111,7 +111,7 @@ - (void)setFooterView:(UIView *)footerView [self reloadData]; } -- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)())callback +- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)(void))callback { if ((_state == state) && !force) { @@ -123,7 +123,7 @@ - (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)for // Override } -- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback +- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)(void))callback { [self setState:state animated:animated force:NO callback:callback]; } @@ -140,14 +140,12 @@ - (void)setState:(JBChartViewState)state - (void)setMinimumValue:(CGFloat)minimumValue { - NSAssert(minimumValue >= 0, @"JBChartView // the minimumValue must be >= 0."); _minimumValue = minimumValue; _hasMinimumValue = YES; } - (void)setMaximumValue:(CGFloat)maximumValue { - NSAssert(maximumValue >= 0, @"JBChartView // the maximumValue must be >= 0."); _maximumValue = maximumValue; _hasMaximumValue = YES; } diff --git a/Classes/Line/JBLineChartView.m b/Classes/Line/JBLineChartView.m index 23ac7e18e..f2698d61f 100755 --- a/Classes/Line/JBLineChartView.m +++ b/Classes/Line/JBLineChartView.m @@ -208,7 +208,6 @@ - (void)reloadDataAnimated:(BOOL)animated { NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex"); CGFloat rawHeight = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex]; - NSAssert(isnan(rawHeight) || (rawHeight >= 0), @"JBLineChartView // delegate function - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex must return a CGFloat >= 0 OR NAN"); JBLineChartPoint *chartPointModel = [[JBLineChartPoint alloc] init]; { @@ -863,7 +862,6 @@ - (CGFloat)cachedMinHeight { NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex"); CGFloat height = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex]; - NSAssert(isnan(height) || (height >= 0), @"JBLineChartView // delegate function - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex must return a CGFloat >= 0 OR NAN"); if (!isnan(height) && height < minHeight) { minHeight = height; @@ -890,7 +888,6 @@ - (CGFloat)cachedMaxHeight { NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex"); CGFloat height = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex]; - NSAssert(isnan(height) || (height >= 0), @"JBLineChartView // delegate function - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex must return a CGFloat >= 0 OR NAN"); if (!isnan(height) && height > maxHeight) { maxHeight = height; diff --git a/Classes/Line/Views/JBLineChartDotsView.h b/Classes/Line/Views/JBLineChartDotsView.h index b2321843f..b31566a1a 100644 --- a/Classes/Line/Views/JBLineChartDotsView.h +++ b/Classes/Line/Views/JBLineChartDotsView.h @@ -21,7 +21,7 @@ extern NSInteger const kJBLineChartDotsViewUnselectedLineIndex; @property (nonatomic, strong) NSDictionary *dotViewsDict; // Data -- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback; +- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)(void))callback; - (void)reloadDataAnimated:(BOOL)animated; - (void)reloadData; diff --git a/Classes/Line/Views/JBLineChartDotsView.m b/Classes/Line/Views/JBLineChartDotsView.m index 2d4dc2ef1..17a12376b 100644 --- a/Classes/Line/Views/JBLineChartDotsView.m +++ b/Classes/Line/Views/JBLineChartDotsView.m @@ -39,7 +39,7 @@ - (id)initWithFrame:(CGRect)frame #pragma mark - Data -- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback +- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)(void))callback { NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesForLineChartDotsView:)], @"JBLineChartDotsView // dataSource must implement - (NSArray *)lineChartLinesForLineChartDotsView:(JBLineChartDotsView *)lineChartDotsView"); NSArray *lineChartLines = [self.dataSource lineChartLinesForLineChartDotsView:self]; diff --git a/Classes/Line/Views/JBLineChartLinesView.h b/Classes/Line/Views/JBLineChartLinesView.h index b4f083169..ac5af1d82 100644 --- a/Classes/Line/Views/JBLineChartLinesView.h +++ b/Classes/Line/Views/JBLineChartLinesView.h @@ -20,7 +20,7 @@ extern NSInteger const kJBLineChartLinesViewUnselectedLineIndex; @property (nonatomic, assign) NSInteger selectedLineIndex; // -1 to unselect // Data -- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback; +- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)(void))callback; - (void)reloadDataAnimated:(BOOL)animated; - (void)reloadData; @@ -28,7 +28,7 @@ extern NSInteger const kJBLineChartLinesViewUnselectedLineIndex; - (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated; // Callback helpers -- (void)fireCallback:(void (^)())callback; +- (void)fireCallback:(void (^)(void))callback; @end diff --git a/Classes/Line/Views/JBLineChartLinesView.m b/Classes/Line/Views/JBLineChartLinesView.m index ea335d5cb..032a19884 100644 --- a/Classes/Line/Views/JBLineChartLinesView.m +++ b/Classes/Line/Views/JBLineChartLinesView.m @@ -195,7 +195,7 @@ - (void)drawRect:(CGRect)rect #pragma mark - Data -- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback +- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)(void))callback { NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesForLineChartLinesView:)], @"JBLineChartLinesView // dataSource must implement - (NSArray *)lineChartLinesForLineChartLinesView:(JBLineChartLinesView *)lineChartLinesView"); NSArray *chartData = [self.dataSource lineChartLinesForLineChartLinesView:self]; @@ -584,7 +584,7 @@ - (CABasicAnimation *)basicPathAnimationFromBezierPath:(UIBezierPath *)fromBezie #pragma mark - Callback Helpers -- (void)fireCallback:(void (^)())callback +- (void)fireCallback:(void (^)(void))callback { dispatch_block_t callbackCopy = [callback copy];