Search code examples
iosxcodecatextlayer

iOS - Disable or editing animations of CATextLayer


I working with a CATextLayer var and when try to increase the font or type something in this string there is an animation effect with these actions , How can I edit or disable the animation of CATextLayer ?


Solution

  • You can do this by setting the actions dictionary on the layer to return [NSNull null] as an animation for the appropriate key. for example :

       NSDictionary *newActions = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"contents", nil];
        normalTextLayer_.actions = newActions;
        [newActions release];
    

    o disable fade in / out animations I believe the contents key is the one you're looking for