我正在处理其他人的代码,并且每当执行退出转场时,我都会尝试执行几行,我将界面生成器中 View Controller 的退出导出连接到我的 .swift 文件中的函数 unwindFromChildView ,但是我收到错误:- segue 操作 unwindFromChildView 未定义
最佳答案
确保 unwindFromChildView 函数的签名正确,这是让 unwind segues 正常工作的关键。 iOS 将在导航堆栈的 View Controller 中查找该签名,并将堆栈展开到具有该方法的 View Controller 。
-(IBAction)unwindFromChildView :(UIStoryboardSegue *)segue {
// whatever
}
swift :
@IBAction func unwindFromChildView (segue: UIStoryboardSegue) {
return
}
我希望这会有所帮助。
关于swift - 未定义 segue 操作 unwindFromChildView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37536595/