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

fix warnings and update to current settings #237

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/Bar/JBBarChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ - (CGFloat)barWidth

#pragma mark - Setters

- (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 (self.reloading)
{
Expand Down Expand Up @@ -664,7 +664,7 @@ - (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)for
}
}

- (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 Down
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
4 changes: 2 additions & 2 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 Down
4 changes: 2 additions & 2 deletions Classes/Line/JBLineChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ - (CGFloat)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dimmedSele

#pragma mark - Setters

- (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 (self.reloading)
{
Expand Down Expand Up @@ -814,7 +814,7 @@ - (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)for
}
}

- (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 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
32 changes: 27 additions & 5 deletions JBChartViewDemo/JBChartViewDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
9B2E52F918218CF20079B9D2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = Jawbone;
};
buildConfigurationList = 9B2E52FC18218CF20079B9D2 /* Build configuration list for PBXProject "JBChartViewDemo" */;
Expand Down Expand Up @@ -580,19 +580,30 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -605,7 +616,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -620,25 +631,36 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand All @@ -653,7 +675,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JBChartViewDemo/JBChartViewDemo-Prefix.pch";
INFOPLIST_FILE = "JBChartViewDemo/JBChartViewDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.jawbone.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
Expand All @@ -668,7 +690,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JBChartViewDemo/JBChartViewDemo-Prefix.pch";
INFOPLIST_FILE = "JBChartViewDemo/JBChartViewDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.jawbone.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
Expand Down
20 changes: 3 additions & 17 deletions JBChartViewDemo/JBChartViewDemo/Misc/JBChartInformationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,25 +262,11 @@ - (id)initWithFrame:(CGRect)frame
- (void)layoutSubviews
{
CGSize valueLabelSize = CGSizeZero;
if ([self.valueLabel.text respondsToSelector:@selector(sizeWithAttributes:)])
{
valueLabelSize = [self.valueLabel.text sizeWithAttributes:@{NSFontAttributeName:self.valueLabel.font}];
}
else
{
valueLabelSize = [self.valueLabel.text sizeWithFont:self.valueLabel.font];
}
valueLabelSize = [self.valueLabel.text sizeWithAttributes:@{NSFontAttributeName:self.valueLabel.font}];

CGSize unitLabelSize = CGSizeZero;
if ([self.unitLabel.text respondsToSelector:@selector(sizeWithAttributes:)])
{
unitLabelSize = [self.unitLabel.text sizeWithAttributes:@{NSFontAttributeName:self.unitLabel.font}];
}
else
{
unitLabelSize = [self.unitLabel.text sizeWithFont:self.unitLabel.font];
}

unitLabelSize = [self.unitLabel.text sizeWithAttributes:@{NSFontAttributeName:self.unitLabel.font}];

CGFloat xOffset = ceil((self.bounds.size.width - (valueLabelSize.width + unitLabelSize.width)) * 0.5);

self.valueLabel.frame = CGRectMake(xOffset, ceil(self.bounds.size.height * 0.5) - ceil(valueLabelSize.height * 0.5), valueLabelSize.width, valueLabelSize.height);
Expand Down