I have an UIView
with several other UIViews
as subviews
. Each one of these subviews
can be clicked, and when they are they will animate their layer
and "pop" out which makes it look like it's selected. But in each subview
I also have a Lottie animation.
When I select one of these subview UIViews
the Lottie Animation is not tagging along, it simply pops into the right position after my select animation is finished. It's almost as if the layer
of my Lottie animation is not in my UIViews layer hierarchy
. But if I don't play my lottie animation and simply pause it, it works fine. This is how I create my lottie animation object, from a json created in After Effects:
- (CALayer *)fetchAnimationForIcon:(NSString *)iconName {
LOTAnimationView *a = [LOTAnimationView animationNamed:iconName];
[a play];
return a.layer;
}
I then add this layer
as a sublayer
to the UIView
calling this method. I then proceed to animate the select animation on this UIView
, which causes a.layer
to pop or blink into correct position. It simply isn't animating while running. But if I don't play the animation it all works fine.