appcoda tutorial, 당신은 SwitchViewController, 두 개의 다른 전망을 말해, 다음과 같은 간단한 튜토리얼을 확인 , BlueViewController 및 YellowViewController 사람들을 호출 할 수 있습니다. 당신의 버튼을 누르면
는
그런 다음 다음과 같은 조치를 사용할 수 있습니다 을 - (IBAction를) switchViews { [UIView의 beginAnimations : "보기 플립"컨텍스트 @ : NULL]; [UIView setAnimationDuration : 1.4]; [UIView setAnimationCurve : UIViewAnimationCurveEaseInOut];
if(!self.yellowViewController.view.superview) {
if(!self.yellowViewController){
self.yellowViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Yellow"];
}
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO];
[self.blueViewController.view removeFromSuperview];
[self.view insertSubview:self.yellowViewController.view atIndex:0];
} else {
if(!self.blueViewController){
self.blueViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Blue"];
}
[UIView setAnimationDuration:0.2];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:1];
[self.yellowViewController.view removeFromSuperview];
[self.view insertSubview:self.blueViewController.view atIndex:0];
}
[UIView commitAnimations];
}
매우 자명해야합니다. 질문이 생기면 들으십시오.
스택 오버플로 질문, 온라인 자습서 및이 질문에 이미 사용 가능한 기타 리소스가 많이 있습니다. Stack Overflow에 관한 새로운 질문을하기 전에 철저히 조사하십시오. 그래도 힌트가 있습니다 : 스토리 보드가 필요합니다. – hgwhittle
[공식 문서] (https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html)를 참조하고 철저히 조사하십시오. 이 질문은 이전에 여러 번 묻는 질문입니다. – n00bProgrammer