I've got some code inside one of my view controllers that will make sliding transition from one view to another:
-(void)transitionToNewView:(UIView*)newView
{
UIView *superView = [self.view superview];
[superView addSubview:newView];
newView.frame = superView.bounds;
[self.view removeFromSuperview];
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[superView layer] addAnimation:animation forKey:@"keygoeshere"];
}
The sliding transition seems to work correctly, but I'm also seeing the new view fade in from a blank screen in addition to the sliding. I suspect that this is because I'm adding a new view to the super view that wasn't there before. What I'd like to do is the same thing, but without the fading in. How can I do this?