【发布时间】:2016-10-04 00:12:13
【问题描述】:
我有一个自定义 UIStoryboardSegue 可以“缩放”UIImageView。现在我还需要一个自定义的UIStoryboardSegue,当用户按下UINavigationController 中的后退按钮时它会“缩小”。这几天我一直在尝试这样做,但没有成功。
我对@987654326@ 进行了子类化,并在其中添加了以下代码:
- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier {
UIStoryboardSegue *theSegue;
NSLog(@"Unwind called");
if ([fromViewController isKindOfClass:[SetDetailViewController class]]) {
theSegue = [ZoomOutSegue segueWithIdentifier:identifier source:fromViewController destination:toViewController performHandler:^(void){}];
} else {
theSegue = [super segueForUnwindingToViewController:toViewController fromViewController:fromViewController identifier:identifier];
}
return theSegue;
}
但是,这没有被调用。我在这里做错了什么?
【问题讨论】:
-
你继承 UINavigationController 的原因是什么?
-
你想从模型 viewController 中放松吗?
-
不,来自推送的视图控制器
-
那么就不需要继承UINavigationController了。所以从放弃子类开始。其次,您是否将展开转场连接到实际按钮?
标签: ios objective-c uinavigationcontroller uistoryboardsegue