ios - check the segue used to open viewController in the viewController itself -


having methods:

//metodo che verifica se proveniamo dal profile controller o da un altro controller override func prepare(for segue: uistoryboardsegue, sender: any?) {     if segue.identifier == "accountsegue" {         self.disattivatutorialbtn.ishidden=true          indietrobtn.ishidden=false     }else{         self.indietrobtn.ishidden=true         self.disattivatutorialbtn.ishidden=false     }   } 

i perform different actions basing on segue's identifier. of course, method isn't called anywhere (i understood is): how can call it? seems stupid calling "self" method in "viewdidload" doesn't work.

to instead of performing segue on button click in storyboard, create segue viewcontroller other view controller. when want go next view controller call below button click or other action event.

self.performsegue(withidentifier: "accountsegue", sender: self) 

this automatically call prepareforsegue method , if statement execute.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -