AfonsoTsukamoto / ATTutorialController

A tutorial controller ready to use. Uses its own UIWindow.
MIT License
83 stars 10 forks source link

App crashes when you tap the tutorial really fast #4

Open mightymietz opened 9 years ago

mightymietz commented 9 years ago

Hi,

when you tap the tutorial really fast the app crashes. This happens because the cleanup method is called before all animations did finish. I fixed this issue by implementing the Quartzcore framework and add the line [UIView setAnimationDelegate:self] in the init method. Then I added the two methods

This allows me to set a BOOL isAnimting whenever the animation starts or stops.

Then I changed the swipeOrStopTapInWindow method like this:

-(void)swipeOrTapInWindow:(UISwipeGestureRecognizer*)sender {

warning animation should stop before running this line

if(!self.isAnimating)
    [self animateToNextTutorialStepOrStop];

}

Maybe you can try this and add this to your code.

Kind regards

David

AfonsoTsukamoto commented 9 years ago

Hi! And thanks a lot for the report. I can test it locally for that bug and try your approach to fix it.

I'll try that soon™ :+1: