Skip to content

Commit

Permalink
Merge pull request levey#10 from jamesinnopage/runloop_fix
Browse files Browse the repository at this point in the history
Adding timer to runloop to make sure UI event won't block expand animation
  • Loading branch information
levey committed Feb 16, 2012
2 parents 7eef940 + 2d07daa commit 9e5d100
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion AwesomeMenu/QuadCurveMenu/QuadCurveMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ - (void)setExpanding:(BOOL)expanding
{
_flag = self.isExpanding ? 0 : ([_menusArray count] - 1);
SEL selector = self.isExpanding ? @selector(_expand) : @selector(_close);
_timer = [[NSTimer scheduledTimerWithTimeInterval:timeOffset target:self selector:selector userInfo:nil repeats:YES] retain];

// Adding timer to runloop to make sure UI event won't block the timer from firing
_timer = [[NSTimer timerWithTimeInterval:timeOffset target:self selector:selector userInfo:nil repeats:YES] retain];
[[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
}
}
#pragma mark - private methods
Expand Down

0 comments on commit 9e5d100

Please sign in to comment.