Application screen sequence in iOS app

122 views Asked by At

In the application I can go from screen A to B to C. Also I can go from screen A to E and also I can go from screen C to E.

I want to know the entry point from where Controller E is presented.

PS : application is storyboard less and can’t post code due to confidentiality.

App is in Swift 3. Looking for some suggestions.

2

There are 2 answers

0
stevenpcurtis On

The most simple way is to pass some data in your segue

i.e.

if segue.identifier == "showDest"{
let destVc = segue.destination as! YourViewController
destVC.source = currentVC
}
0
Geet On

why dont you just use the parent property of E viewController and check the source that presented it you can do something like

           if let parentController = self.parent as? A {
           //do smething
           }
           else if let parentController = self.parent as? C {
           //do smething
            }