Here is the view that I created using Storyboard:
Clouds, avatar image button, and other text buttons, etc. are its subviews. In its viewDidAppear
method, I added several animation methods which cause the clouds to "float" horizontally, for example:
[UIView animateWithDuration:4.0f
delay:0.0f
options:(UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction)
animations:^{
_cloud1.frame = its new frame so that it looks to float horizontally;
}
completion:nil];
Now I have another subview which I created using a XIB file. It's basically a custom-sized subview which will appear when the avatar image button is tapped (we can think of it as "editing profile screen" in social apps). I added it with this animation block (please note that it justs appear on top of the purple circle, which is actually not removed):
_editProfileViewController = [[EditProfileViewController alloc] initWithNibName:nil bundle:nil];
[self addChildViewController:_editProfileViewController];
[_editProfileViewController didMoveToParentViewController:self];
[UIView transitionWithView:self.view duration:0.3 options:(UIViewAnimationOptionTransitionCrossDissolve) animations:^
{
[self.view addSubview:_editProfileViewController.view];
} completion:NULL];
Problem: When I do that, all clouds stop animating (while the transition still works).
Any ideas? Thank you.