Reputation: 5591
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.
Upvotes: 0
Views: 123
Reputation: 2437
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
}
Upvotes: 1
Reputation: 2001
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
}
Upvotes: 0