samedi 29 novembre 2014

Is it ok to control all the view modals in 1 action method from this view controller?

I have a view controller which is the homepage of the app, now i'm trying to figure out the right way to modal between screens, so what I did is from the HomePageViewController.m I created an action method call homeModals , I controlled dragged connections between two buttons I want to perform segues from the method looks like this:



- (IBAction)homeModals:(id)sender {

[self performSegueWithIdentifier:@"createModal" sender:self];
[self performSegueWithIdentifier:@"stackModal" sender:self];
}


Now I also controlled dragged from those buttons to the screens I wanted to segue to that and gave identifiers to those segues that calls "createModal" and "stackModal".


I wanted to know if this is a right way to modal between screens?


Some other problem i'm looking to solve is how do I check the identifier before I call the performSegue method so I don't call methods that don't need to be called?


tnx




Aucun commentaire:

Enregistrer un commentaire