1

I have an app that represents a folder structure. I have a UITableViewController for the folders and files listing, and a UIViewController for the Documents.

I want to be able to recursively navigate through the folder structure, so I want to reuse the Folder UITableView multiple times while I let the user drill down a folder structure.

Is there a way to draw a segue from the UITableViewController to self so when I select a folder I present another instance of the view, but with the content of the subfolder?

I did this in previous versions of Xcode, but I cannot figure this out on Xcode 9.

agarcian
  • 3,909
  • 3
  • 33
  • 55
  • Does this answer your question? [Storyboard Segue From View Controller to Itself](https://stackoverflow.com/questions/9226983/storyboard-segue-from-view-controller-to-itself) – malhal Jan 29 '20 at 15:40

3 Answers3

2

You can use Storyboard Reference and Storyboard ID of ViewController in Interface Builder Screenshot

Gidsor
  • 21
  • 4
0

Yes you can do it. Add a hidden button in view controller and drag & drop segue self view controller.

0

I've never created a segue link to the same view controller, but based on Halil's answer above, it sounds like it's possible.

Rather than messing with hidden buttons, though, why don't you give your scene a storyboard identifier, and then instantiate and push/present your view controller through code? You could put your logic in the table view's tableView(_:didSelectRowAt:) method.

Duncan C
  • 128,072
  • 22
  • 173
  • 272