Eric
Eric

Reputation: 16921

Preventing the dismissal of a view controller in a segue

I am using StoryBoards and am trying to overlay a View Controller's view on top of another View Controller's view so that the two are visible (the top one has a couple of transparent areas).

If I connect the two together with a modal Segue and then call [self performSegueWithIdentifier:@"showTutorial" sender:nil]; the source view is removed and the destination one is shown. No joy.

If I connect them with a push Segue, calling [self performSegueWithIdentifier:@"showTutorial" sender:nil]; doesn't bring up the new view. Embedding the source view controller in a Navigation Controller brings up the destination view, but also removes the source view. No joy.

Any suggestions?

Upvotes: 1

Views: 455

Answers (1)

Eric
Eric

Reputation: 16921

@Inafziger: I thought I would have been able to do that with a segue, but segues are not the way. Also, as I wanted to keep working with the Storyboard and avoid making a new nib file from scratch, here's what I did:

tutorialView = [self.storyboard instantiateViewControllerWithIdentifier:@"Tutorial"];

[self.view addSubview:tutorialView.view];

Then in the Storyboard, write "Tutorial" in the ViewController's Identifier field.

Upvotes: 3

Related Questions