How can I exclude a piece of code inside a core animation block from being animated?

前端 未结 1 1554
无人及你
无人及你 2021-01-03 10:11

I have an core animation block where I call a method that will load a view controller. there is an custom transition between two view controllers happening. However, when th

相关标签:
1条回答
  • 2021-01-03 10:57

    You should be able to suppress animations for a section of the UIView animation block by wrapping that section in a CATransaction and disabling animations for it:

    [CATransaction begin];
    [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];    
    
    // Changes to disable animation for here
    [CATransaction commit];
    
    0 讨论(0)
提交回复
热议问题