Question

I got viewcontroller with navigation bar. I move from it to another VC with pushViewcontroller.

Destination viewController has view with data writing in code. My navigation controller is closes part of my view. How can I shift my view's data bellow inserting navigation VC?

Was it helpful?

Solution

I would use (void)prepareforSegue

First create a property in your next view controller, for this example I'm calling it ViewData.

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{

if ([segue.identifier isEqualToString:@"Your Identifier])
{

YourNextViewController *vc = (YourNextViewController*)segue.destinationViewController;
  [vc setViewData: @"Whatever data"];

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top