Display whole ViewController within another ViewController's view?

You can show another view controller's views as subviews but their outlets and actions remain linked to their original view controller unless you write code to make new connections, so self. Whatever shouldn't be expected to affect the other view controller's properties.

Up vote 0 down vote favorite share g+ share fb share tw.

Im writing an application which the main view controller is a UIViewController. It has some icons in a grid and I want to dismiss (sliding down) this grid when one of the icons is clicked. This I've done already.

The problem is: when the grid is dismisseed I want another View to come from the top of the screen. This view is in this same root view controller. But I want to display the content of other view controllers in this view.

For example: I want this view to show a UINavigationController with a UITableView inside it, so the user can navigate through TableViews. I'm doing this: HorariosViewController *horarios = HorariosViewController alloc init; vuashView addSubview:horarios. View; HorariosViewController is a UINavigationViewController.

It shows me only a blue NavigationBar and changes like self.navigationItem. Title = @"Title" won't work. Thanks!

Iphone navigation storyboard tableview link|improve this question edited Apr 6 at 17:21 asked Apr 6 at 17:06gabriel_vincent356 79% accept rate.

You can show another view controller's views as subviews but their outlets and actions remain linked to their original view controller unless you write code to make new connections, so self. Whatever shouldn't be expected to affect the other view controller's properties. (Also, if HorariosViewController is a UINavigationController, it shouldn't be created as a UIViewController.

).

One approach is to have the navigation controller already there, with the icon grid presented modally on top of it. (you can set the view up this way without animations, so the user doesn't see the navigation controller underneath). Then, when it's time for the grid to go away, it can call dismissModalViewController on itself with animation.

That's a good solution, but I want sometjing a little bit different: when the grid is dismissed it doesn't disappear completely from the view, just like the Facebook app, but vertically. – gabriel_vincent Apr 6 at 17:24 Okay. What does that icon grid do?

If it's simple enough, you can make it a view (not a view controller) which is a subview of the navigation controller. You can write your own simple animation to slide it in and (partially) out of the way. Two view controllers owning bits of the screen together is not outlawed, but it's not at all recommended.

Let me know if that's plausible, and I'll add a little illustration code to my answer. – danh Apr 6 at 17:30 I have the animation working alredy, it slides down the grid, but keeps it still visible, so the user can return to the menu. The icon grid is a UIImageView.

My problem is displaying the contents of other view controllers when some icon is clicked. I thought of another solution: perform the animation and, at the end of the animation, present a modal (without animation) view controller with the desired view controller, and designed to look like it is still in the same view by adding an image of the top of the grid in the bottom of the window. But I still can't see the data in the viewcontroller – gabriel_vincent Apr 6 at 17:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions