简体   繁体   中英

UIView animations intermittently fail, app-wide

Occasionally, my app will simply not render any frame-relayed animations triggered by +[UIView animateWithDuration:animations:] and friends.

The completion block, when provided, still gets called as I'd expect, but the views simply "snap" into the destination frame, as if I'd simply called -setFrame: .

It is across the whole app, and is completely independent of which view controller is displaying, and whether or not the VC is modally presented. Restarting the app solves the problem temporarily.

Note: This is obviously not enough information to solve the problem, but I'm not even sure where to begin. Comments on where to start debugging are greatly appreciated.

Update: It seems to be reproducible by running a series of animations in succession. If I trigger several animations to run overtop of each other, it would seem animations just turn off, app-wide.

For posterity:

The issues that, direct frame-setting was occurring on a background thread.

To fix the issue, I needed to ensure that that code was getting run on the main thread.

That being said, since I could not post enough code to really substantiate this issue, I'm going to vote to close it as off-topic. Thanks for all your help!

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