I have this story board :
my first ViewController has PNG image as background programatically :
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgleft"]];
}
my second ViewController has transparent background by selecting Clear Color as Background property on Storyboard.
but when it runs on my iPod, it seems that my second ViewController has same background but pushing first ViewController background from right to left.
what I want to do is :
when Segue detected, it will move all UI components on first ViewController from current position to left so it feels like its all being pushed by second ViewController (but not the background, I want to keep the background in its position).
then, all UI components on second ViewController enters using Push Transition which I already set on Storyboard as transparent ViewController.
So, it will gives smooth transition from one ViewController into another without moving the background.
I tried using this code :
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"goToViewTwo"])
{
UIViewController *view2 = segue.destinationViewController;
view2.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgleft"]];
}
}
but I don't know how to move / animate all UI components (button, label, etc) to perform as I described. please kindly tell me what to do.. thank you.
In second viewController paste this source
I think you can do this by making both controllers have a transparent background, and adding the background image to the window instead.