Shruti
Shruti

Reputation: 5591

Application screen sequence in iOS app

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

Answers (2)

Geet
Geet

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

stevenpcurtis
stevenpcurtis

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

Related Questions