Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segue from the view controller embedded in a container view

My application has a UIViewController which is embedded in a UINavigationController. The UIViewController has a container view inside it. I connect this container view to a UITableViewController thereby embedding it in the container view. It's fine until now.

Now when I connect this UITableViewController to a new UIViewController using the push segue (we are still in the navigation view) in the storyboard, the size of the new UIViewController scene becomes same as that of the container view. I guess this is expected but is there some way not to make this happen. I want the remaining scenes to be in the normal size. Also, its working pretty fine and as expected when running in the simulator. The problem with the size is only pertained to the storyboard.

Just explaining my controller - view hierarchy here:

UINavigationController 
  -> UIViewController ( Initial View Controller )
    -> Container View 
      -> UITableViewController ( Embed Segue ) 
        -> UIViewController ( Push Segue ) 

Is there any way so that the last UIViewController and the remaining connected controller scenes are of normal sizes in the storyboard?

like image 579
Sunil Avatar asked Oct 01 '22 04:10

Sunil


1 Answers

Here is one solution: Create a manual segue from your Initial View Controller to the desired destination. This will prevent the storyboard from getting confused and giving the destination the wrong size (and other inferred metrics). Unfortunately, because it is a manual view controller, you will have to perform the segue in code from your embedded view controller by doing something like this:

[self.parentViewController.parentViewController performSegueWithIdentifier:@"MySegue" sender:self];
like image 71
vocaro Avatar answered Oct 13 '22 12:10

vocaro