私のxibファイルで設定したツールバーのUIButtonが押されたときに、新しいコントローラーがビューに読み込まれるようにしようとしています。
どうすればそれを実装できますか? FlipViewController を複製しようとしましたが、これらを複数持つことはできないと思います。
私のxibファイルで設定したツールバーのUIButtonが押されたときに、新しいコントローラーがビューに読み込まれるようにしようとしています。
どうすればそれを実装できますか? FlipViewController を複製しようとしましたが、これらを複数持つことはできないと思います。
次のような素敵なアニメーションで切り替えることができます: ( でコメントされている行を変更しない限り、 app-delegate でのみ機能し// works only in app delegate
ます。
UIViewController *ctrl = [[UIViewController alloc] initWithNibName:@"someXIBStuff" bundle:nil];
CAKeyframeAnimation *theAnimation = [CAKeyframeAnimation animation];
theAnimation.values = [NSArray arrayWithObjects:
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.12,1.12,1)],
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1,1,1)],
nil];
theAnimation.cumulative = YES;
theAnimation.duration = 0.3;
theAnimation.repeatCount = 0;
theAnimation.removedOnCompletion = YES;
theAnimation.timingFunctions = [NSArray arrayWithObjects:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn],
nil
];
[self.window.layer addAnimation:theAnimation forKey:@"transform"];
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.delegate = self;
[self.window.layer addAnimation:transition forKey:nil];
self.window.rootViewController = ctrl; // works only in app delegate
[ctrl release];