Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes "This block declaration is not a prototype" on Xcode 9 #234

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Base/JBChartView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions Classes/Base/JBChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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];
}
Expand All @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions Classes/Line/JBLineChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
{
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Line/Views/JBLineChartDotsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Line/Views/JBLineChartDotsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions Classes/Line/Views/JBLineChartLinesView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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;

// Setters
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated;

// Callback helpers
- (void)fireCallback:(void (^)())callback;
- (void)fireCallback:(void (^)(void))callback;

@end

Expand Down
4 changes: 2 additions & 2 deletions Classes/Line/Views/JBLineChartLinesView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];

Expand Down