My app will use a simple login type selcector view controller, and from that it'll branch out to different view controllers, i.e. Sign Up, Sign In, and Sign In with Social networks. Now how do I add a segue from all of these to one single destination view controller. How do I add these multiple segues.

有帮助吗?

解决方案

Every ViewController should have their own seque. To create, press "Ctrl" and move to the ViewController you want

enter image description here

And every ViewController should implement "prepareForSegue"

- (void)prepareForSegue:(UIStoryboardPopoverSegue *)segue sender:(id)sender {
    if ([segue.destinationViewController isKindOfClass:[MyDestinationVC class]]) {
        //do something
        //Example
        MyDestinationVC *screen = (MyDestinationVC *)segue.destinationViewController;
        screen.someValue = self.sendedValue;
    }
}

其他提示

If you have segues between one view(LoginVC) to others (login, social login, etc...) System already knows last viewcontroller from which you came to newer viewcontroller. You just execute [self dismissViewControllerAnimated:YES completion:nil]; or put system barbuttons like UIBarButtonSystemItemDone to take care of dismissal by system itself to go back.

Unless you have some other problem, this solution should work for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top