简体   繁体   中英

UIView Animate Doesn't Respect Delay?

Why does this not work?

[UIView animateWithDuration:0 delay:3 options:0 animations:^(void) { 
    NSLog(@"after duration, please!");
}  completion:nil];

The NSLog fires immediately.

I'm not looking for workarounds (there are many), but rather wondering why this would be.

The intermediate frames of core animation are actually happening in another background thread. The first and last frame of the animation are often created immediately. So the NSLog can fire in the main UI thread without waiting or even knowing about any background animation in progress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM