Perform a task (in iOS) after animation has finished

后端 未结 4 716
离开以前
离开以前 2021-02-04 07:11

So I have this line of code:

[tableView setContentOffset:point animated:YES];

and I want to run another piece of code after the animation ends. My a

4条回答
  •  温柔的废话
    2021-02-04 07:51

    Try to use this method:

    [UIView animateWithDuration:0.6f
                          delay:0.0f
                        options:UIViewAnimationOptionCurveEaseOut
                     animations:^{
                         // Do your animations here.
                     }
                     completion:^(BOOL finished){
                         if (finished) {
                             // Do your method here after your animation.
                         }
                     }];
    

提交回复
热议问题