How to disable the animation for the presentation and all this temporarily displays?

I have some views with subviews and animations are happening. Before using shouldRasterize = YES I want to turn off animation, so that all animation commands will be ignored inside this branch of the view hierarchy.

Is there an easy way to do this?

+6
source share
2 answers

As Victor said, you can use the static + (void)setAnimationsEnabled:(BOOL)enabled UIView method to turn off the animation. However, calling this method will disable the animation for all views. Remember to enable the animation later. Due to disabling animation for a certain hierarchy of views, but there are no others, this is not possible.

+6
source

You can use the following static method in a UIView:

 + (void)setAnimationsEnabled:(BOOL)enabled 

See reference for more details.

+8
source

Source: https://habr.com/ru/post/903027/


All Articles