Skip to content

Commit 2faf366

Browse files
committed
removal of the detail view when needed
1 parent f252515 commit 2faf366

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

MPBarsGraphView.m

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ - (void)drawRect:(CGRect)rect
3535

3636
if (self.values.count && !self.waitToUpdate) {
3737

38-
if(self.detailView.superview)
39-
[self.detailView removeFromSuperview];
4038

4139
for (UIView *subview in self.subviews) {
4240
[subview removeFromSuperview];

MPGraphView.m

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ - (void)drawRect:(CGRect)rect
4141

4242
if (self.values.count && !self.waitToUpdate) {
4343

44-
if(self.detailView.superview)
45-
[self.detailView removeFromSuperview];
46-
4744
((CAShapeLayer *)self.layer).fillColor=[UIColor clearColor].CGColor;
4845
((CAShapeLayer *)self.layer).strokeColor = self.graphColor.CGColor;
4946
((CAShapeLayer *)self.layer).path = [self graphPathFromPoints].CGPath;
@@ -140,6 +137,10 @@ - (CGPoint)pointAtIndex:(NSInteger)index{
140137

141138
- (void)animate{
142139

140+
if(self.detailView.superview)
141+
[self.detailView removeFromSuperview];
142+
143+
143144
self.waitToUpdate=NO;
144145

145146
gradient.hidden=1;
@@ -161,6 +162,8 @@ - (void)animate{
161162
[button removeFromSuperview];
162163
}
163164

165+
166+
164167
buttons=[[NSMutableArray alloc] init];
165168

166169
CGFloat delay=((CGFloat)self.animationDuration)/(CGFloat)points.count;

MPPlot.m

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,18 @@ + (id)plotWithType:(MPPlotType)type frame:(CGRect)frame{
5252
return nil;
5353
}
5454

55-
#pragma mark Common
5655

5756

5857

58+
- (void)drawRect:(CGRect)rect{
59+
60+
[super drawRect:rect];
61+
62+
if(self.detailView.superview)
63+
[self.detailView removeFromSuperview];
5964

65+
66+
}
6067

6168

6269

0 commit comments

Comments
 (0)