0

I would like to detect the segues that are associated to a particular View Controller on any of its elements but I cannot find any information about how to control it.

I know that I can make reference to a segue with an identifier but I would like to know all the ID's of each segue that are associated to the elements of a particular View Controller.

Is that possible?

Thanks in advance!

Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
  • Why would you need something like this? segue should be a constant value in your project and always work – Tj3n Sep 08 '16 at 09:32
  • @Tj3n Because I need to switch between two View Controllers and I suspect that when I remove the first one of his ancestor, the segue is removed. The problem is that when I try to insert the new one View Controller as a child I need to be embeded to that segue. I just want to check that I am on the right way and the segue is being removed when I remove the first child View Controller. – Francisco Romero Sep 08 '16 at 09:36
  • @Tj3n Just for debug the actual situation of my storyboard. – Francisco Romero Sep 08 '16 at 09:37
  • Segue that you create from Stroyboard are stored in the XML file which is loaded after main() function is executed and AppDelegates gets the invocation. So you could try to have a script that runs at each build and store it in plist which you read while you are in the program. – kandelvijaya Sep 08 '16 at 09:41
  • @NDoc Adding a do-catch block to my `performSegueWithIdentifier` gives me an alert: `'catch' block is unreachable because no errors are thrown in 'do' block`. It does not have sense as I want to handle if it gives an error or not. – Francisco Romero Sep 08 '16 at 09:55
  • Sorry mate, i though that may help you. – Nirav D Sep 08 '16 at 10:10

1 Answers1

-1

I don't know if this is helpful, but if the issue is trying to figure out something in the view hierarchy, I've used this link :

Recursive Description Method

Basically, add a breakpoint to your code in the area you want to figure out the view hierarchy then use this command in the lldb debug console :

expr -l objc++ -O -- [UIViewController _printHierarchy]
Community
  • 1
  • 1