I have a view (default from UIViewController), an image view above and tool bar at top.
Toolbar
---------
UIImageView
-----------
UIView
This is the basic structure. I want to animate the UIView and UIImageView only not toolbar, currently when I used the code
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setType:kCATransitionPush];
if ([directionScrolled isEqualToString:@"1"]) {
[animation setSubtype:kCATransitionFromRight];
}
else if([directionScrolled isEqualToString:@"2"]){
[animation setSubtype:kCATransitionFromLeft];
}
[animation setDuration:0.20];
[animation setTimingFunction:
[CAMediaTimingFunction functionWithName:
kCAMediaTimingFunctionDefault]];
[[self.view layer] addAnimation:animation forKey:kCATransition];
the whole view animated,(along with toolbar). I want to exclude toolbar from animating.
You can rearrange your UI structure like this
UIView ( this view is assigned to UIViewController ) | |------Toolbar |------UIView ( lets take another UIView and name it as myView) |-------UIImageViewAnd then execute the same code of yours.
Except,
Be sure that