내 viewControllers 사이에 사용자 지정 전환을 만들려고합니다. this 튜토리얼을 따르고 있지만 버튼을 클릭하거나 아무 것도하지 않으면 아무 일도 일어나지 않습니다! 사용자 지정 Segue With Catransition 작동하지 않습니다.
이
는 CustomSegue.m#import "CustomSegue.h"
#import "QuartzCore/QuartzCore.h"
@implementation CustomSegue
-(void)perform {
NSLog(@"ActionTest");
UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
UIViewController *destinationController = (UIViewController*)[self destinationViewController];
CATransition* transition = [CATransition animation];
transition.duration = .25;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
transition.subtype = kCATransitionFromLeft; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
[sourceViewController.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[sourceViewController.navigationController pushViewController:destinationController animated:NO];
}
@end
로그가 기록 용 코드 있지만 전이도 수행되지 않으며의 ViewController 변경된다. segue 스타일을 "custom"로 변경하고 "ZHCustomSegue"클래스로 변경했습니다.
나는 뭔가가 있습니까?
이 당신
스토리 보드에서 맞춤 segue의 스크린 샷을 공유 할 수 있습니까? ⌘ 누가 4 – Can
을 사용할 수 있습니다. 스토리 보드 파일에서 세그먼트 유형을 ZHCustomSegue로 변경 했습니까? –
@Can, 안타깝게도 사진을 업로드하려면 10 개의 평판이 필요합니다. http://s13.postimg.org/8pgyvfhl3/Screen_Shot_2013_07_22_at_10_41_57_AM.png –