Search code examples
iosxcodesegueuistoryboardsegue

Can you define a Segue in the storyboard to self?


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.


Solution

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