-(UIStoryboardSegue *)segueForUnwindingToVIEwController:(UIVIEwController *)toVIEwController fromVIEwController:(UIVIEwController *)fromVIEwController IDentifIEr:(Nsstring *)IDentifIEr {UIVIEwController *controller = self.topVIEwController;UIStoryboardSegue *unwindSegue;if ([controller isKindOfClass:[YourClassthatNeedsCustomUnwind class]]) { unwindSegue = [controller segueForUnwindingToVIEwController:toVIEwController fromVIEwController:fromVIEwController IDentifIEr:IDentifIEr];}if (unwindSegue) { return unwindSegue;} else { return [super segueForUnwindingToVIEwController:toVIEwController fromVIEwController:fromVIEwController IDentifIEr:IDentifIEr];}}
然后在需要自定义展开segue的UIVIEwController中覆盖此方法:
- (UIStoryboardSegue *)segueForUnwindingToVIEwController:(UIVIEwController *)toVIEwController fromVIEwController:(UIVIEwController *)fromVIEwController IDentifIEr:(Nsstring *)IDentifIEr {YourCustomUnwindSegue *segue = [[YourCustomUnwindSegue alloc] initWithIDentifIEr:IDentifIEr source:fromVIEwController destination:toVIEwController];return segue; }
最后在您的自定义UIStoryboardSegue类中,只需覆盖“ – (voID)perform:”方法,并放置您需要的任何动画(或者在我的情况下缺少动画).
- (voID)perform{UINavigationController *containerVC = (UINavigationController*)[self.destinationVIEwController parentVIEwController];[containerVC popToVIEwController:self.destinationVIEwController animated:NO];}
希望这有助于某人.
总结以上是内存溢出为你收集整理的ios – Unwind Segue的自定义Segue类全部内容,希望文章能够帮你解决ios – Unwind Segue的自定义Segue类所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)