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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -