Compare commits

...

4 Commits

Author SHA1 Message Date
Terry Worona 8dbb2679ee Updated log, spec and read me 2014-05-06 14:05:24 -07:00
Terry Worona 867466d1d1 More more compile error 2014-05-06 14:04:17 -07:00
Terry Worona 2046131143 Updated read me, pod spec, etc. 2014-05-06 13:40:21 -07:00
Terry Worona 208a727d88 Fixed compiler warnings 2014-05-06 13:38:24 -07:00
4 changed files with 27 additions and 15 deletions
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.3">2.5.3</a>
#### 05/06/14
- More compiler warning fixes.
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.2">2.5.2</a>
#### 05/06/14
- Fixed compiler warnings.
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.1">2.5.1</a>
#### 05/05/14
- Additional fixes to issue <a href="https://github.com/Jawbone/JBChartView/pull/48">#48</a>.
+16 -12
View File
@@ -410,7 +410,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
CGFloat maxLineWidth = 0.0f;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
for (int lineIndex=0; lineIndex<[self.dataSource numberOfLinesInLineChartView:self]; lineIndex++)
for (NSUInteger lineIndex=0; lineIndex<[self.dataSource numberOfLinesInLineChartView:self]; lineIndex++)
{
BOOL showsDots = NO;
if ([self.dataSource respondsToSelector:@selector(lineChartView:showsDotsForLineAtLineIndex:)])
@@ -622,7 +622,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
} completion:^(BOOL finished) {
[UIView animateWithDuration:kJBLineChartViewStateAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
adjustViewFrames();
} completion:^(BOOL finished) {
} completion:^(BOOL adjustFinished) {
if (callback)
{
callback();
@@ -778,8 +778,8 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
- (NSInteger)lineIndexForPoint:(CGPoint)point
{
// Find the horizontal indexes
NSInteger leftHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampLeft];
NSInteger rightHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampRight];
NSUInteger leftHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampLeft];
NSUInteger rightHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampRight];
// Padding
CGFloat chartPadding = [self padding];
@@ -1041,7 +1041,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
path.miterLimit = kJBLineChartLinesViewMiterLimit;
JBLineChartPoint *previousLineChartPoint = nil;
CGFloat previousSlope;
CGFloat previousSlope = 0.0f;
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:smoothLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (BOOL)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView smoothLineAtLineIndex:(NSUInteger)lineIndex");
BOOL smoothLine = [self.delegate lineChartLinesView:self smoothLineAtLineIndex:lineIndex];
@@ -1140,12 +1140,14 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
_selectedLineIndex = selectedLineIndex;
__weak JBLineChartLinesView* weakSelf = self;
dispatch_block_t adjustLines = ^{
for (CALayer *layer in [self.layer sublayers])
for (CALayer *layer in [weakSelf.layer sublayers])
{
if ([layer isKindOfClass:[JBLineLayer class]])
{
if (((JBLineLayer *)layer).tag == _selectedLineIndex)
if (((NSInteger)((JBLineLayer *)layer).tag) == weakSelf.selectedLineIndex)
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:selectedColorForLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectedColorForLineAtLineIndex:(NSUInteger)lineIndex");
((JBLineLayer *)layer).strokeColor = [self.delegate lineChartLinesView:self selectedColorForLineAtLineIndex:((JBLineLayer *)layer).tag].CGColor;
@@ -1155,7 +1157,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:colorForLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView colorForLineAtLineIndex:(NSUInteger)lineIndex");
((JBLineLayer *)layer).strokeColor = [self.delegate lineChartLinesView:self colorForLineAtLineIndex:((JBLineLayer *)layer).tag].CGColor;
((JBLineLayer *)layer).opacity = (_selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : kJBLineChartLinesViewDefaultDimmedOpacity;
((JBLineLayer *)layer).opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : kJBLineChartLinesViewDefaultDimmedOpacity;
}
}
}
@@ -1278,16 +1280,18 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
_selectedLineIndex = selectedLineIndex;
__weak JBLineChartDotsView* weakSelf = self;
dispatch_block_t adjustDots = ^{
[self.dotViewsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[weakSelf.dotViewsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSUInteger horizontalIndex = 0;
for (JBLineChartDotView *dotView in (NSArray *)obj)
{
if ([key isKindOfClass:[NSNumber class]])
{
NSUInteger lineIndex = [((NSNumber *)key) intValue];
NSInteger lineIndex = [((NSNumber *)key) intValue];
if (_selectedLineIndex == lineIndex)
if (weakSelf.selectedLineIndex == lineIndex)
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartDotsView:selectedColorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // delegate must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView selectedColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
dotView.backgroundColor = [self.delegate lineChartDotsView:self selectedColorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
@@ -1296,7 +1300,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartDotsView:colorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // delegate must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
dotView.backgroundColor = [self.delegate lineChartDotsView:self colorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
dotView.alpha = (_selectedLineIndex == kJBLineChartDotsViewUnselectedLineIndex) ? 1.0f : 0.0f; // hide dots on off-selection
dotView.alpha = (weakSelf.selectedLineIndex == kJBLineChartDotsViewUnselectedLineIndex) ? 1.0f : 0.0f; // hide dots on off-selection
}
}
horizontalIndex++;
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JBChartView"
s.version = "2.5.1"
s.version = "2.5.3"
s.summary = "Jawbone's iOS-based charting library for both line and bar graphs."
s.homepage = "https://github.com/Jawbone/JBChartView"
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.author = { "Terry Worona" => "tworona@jawbone.com" }
s.source = {
:git => "https://github.com/Jawbone/JBChartView.git",
:tag => "v2.5.1"
:tag => "v2.5.3"
}
s.platform = :ios, '7.0'
+1 -1
View File
@@ -38,7 +38,7 @@ Simply add the following line to your <code>Podfile</code>:
Your Podfile should look something like:
platform :ios, '7.0'
pod 'JBChartView', '~> 2.5.1'
pod 'JBChartView', '~> 2.5.3'
### The Old School Way