From XIB to storyboard

I have an application with a storyboard and one window in .xib. From the storyboard in .xib, I move this way:

ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:detailViewController animated:nil]; 

How can I return from a .xib to a storyboard?

And one more question. Can I send some information when switching to .xib from the storyboard? How do I do this through segues in the prepareForSegue method

UPD I received a response about closing .xib. Need an answer to send information.

+4
source share
1 answer

you can return to your storyboard by simply rejecting the modal view controller. Like this:

 - (IBAction)backPressed:(id)sender { [self dismissModalViewControllerAnimated:YES]; } 

You must put this method in your ShowDreamNIBController. Regarding the second question, you can send back information to the view controller that the modal view controller introduced by receiving a link to it using delegation.

EDIT: To β€œsend information to XIB,” do you mean that you want to set the information on the view controller that you want to present? If so, than using this when you present a modal controller:

 ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc]initWithNibName:nil bundle:nil]; [detailViewController setSomething: something]; [detailViewController setAnotherThing: anotherThing]; [self presentModalViewController:detailViewController animated:nil]; 

Hope this helps.

+3
source

Source: https://habr.com/ru/post/1395378/


All Articles