Get a list of all sections related to the view.

I am writing a test for one of my ViewControllers. I need to make sure that the controller has all the segments that it should have in accordance with the design.

I was unable to find information on how to do this.

+4
source share
3 answers

As I said in the comments to find a segment is missing, you can encapsulate a method performSegue... your UIViewController to block try catch , if there is an exception that has been chosen, then one of your segue been removed. (The one that is trying to execute)

+2
source
+2
source

Unfortunately, information about which segues exist is stored in the UIStoryboard internal presentation graph and is not accessible using public APIs. There is no way to get this information so that you can publish it on the App Store.

However, searching for a specific named segue is a kind of fragile way to write this test. Ideally, you should write something like this as an integration test, which ensures that, given that the user is performing an action, the expected view controller is presented.

0
source

Source: https://habr.com/ru/post/1502482/


All Articles