swift - 未定义 segue 操作 unwindFromChildView

标签 swift uistoryboard

我正在处理其他人的代码,并且每当执行退出转场时,我都会尝试执行几行,我将界面生成器中 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/

相关文章:

ios - UI图像大小与实际图像分辨率不同(UIImageWriteToSavedPhotosAlbum)

ios - 使用现有类的 Realm ?

iOS 搜索栏置换

ios - 标签栏不显示在导航 Controller 内的 View Controller 上

ios - 使用 Storyboard在 UIViewController 中初始化自定义 UIView

iphone - 使用自定义动画删除自定义 UIStoryboardSegue

swift - NSUserDefaults 从其他线程移除和设置对象

ios - xcodebuild no such module 'SwiftyJSON' while build in xcode works

ios - 后续 View Controller 中缺少选项卡栏 Controller

ios - 在 Swift 中将字符串(浮点值)转换为 int