How can I restart my block-based animation when the application comes to the foreground?
问题 I have the following block-based animation: [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveEaseInOut animations:^{ [view.layer setTransform:CATransform3DMakeScale(1.3f, 1.3f, 1.0f)]; NSLog(@"animating"); }completion:^(BOOL finished){ NSLog(@"Completed"); }]; When the app returns from being in the background, the completion block is called, and my animations don