问题描述
我正在尝试建立一种机制来深入了解文件/文件夹列表.这个想法是在用户每次选择一个文件夹时显示相同的文件列表视图控制器,如果他/她选择一个文件,则显示一个文件详细信息视图控制器.
I am trying to make a mechanism to drill down a file / folder list. The idea is to show the same file list view controller every time the user selects a folder, and show a file detail view controller if he/she selects a file.
到目前为止,我已经创建了从文件列表视图控制器到文件详细信息视图控制器的转接,以及从文件列表视图单元到文件列表视图控制器的转接:
So far, I have created a segue from the file list view controller to the file detail view controller, and a segue from the file list table view cell to the the file list table view controller:
这个问题是,只要用户点击单元格,segue 就会被执行.我想从表格视图单元格中删除 segue 并从文件列表视图控制器中创建一个到它自己.这样,当用户点击单元格时,我可以以编程方式触发正确的转场.
The issue with this is that as soon as the user taps the cell, the segue is executed. I would like to remove the segue from the table view cell and make one from the file list view controller to itself. That way, I could trigger the right segue programmatically when the user tapped the cell.
所以,我的问题是:是否可以在 Interface Builder 中创建从视图控制器到自身的 segue?
So, my question is: Is it possible to create a segue from a view controller to itself in Interface Builder?
推荐答案
我开发了一种使用幻像按钮创建转场的方法.我相信它会解决你的问题.您可以在我的回答 这里.
I developed a method to create a segue using a phantom button. I believe it will solve your problem. You can read about it in my answer here.
这篇关于Storyboard Segue 从视图控制器到它本身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!