Abdullah Shafique
Abdullah Shafique

Reputation: 6918

UIViewAnimateWithDuration completion never called

I am using the UIView animateWithDuration:delay:options:animations:completion: method but the completion method is never getting called. Here is my code:

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^
             {
                 //random lines of code

             }completion:^(BOOL finished){
                 if (finished)
                 {
                     NSLog(@"FINISHED");
                 }
             }];

EDIT: When I comment out the lines in my animations: it gets called???!!!

These are the lines:

CGFloat objectY = object.frame.origin.y;
objectY += speed;
object.frame = CGRectMake(object.frame.origin.x, objectY, 75, 75);

Upvotes: 0

Views: 586

Answers (1)

Helge Becker
Helge Becker

Reputation: 3243

I am taking a guess - you want to animate the movement of a continuous gesture? If yes, the animation never ends due the user interaction.

Just update the frame, no UIView Animation. Should work just fine.

Upvotes: 1

Related Questions