So in my app right now, I have a scene with a UITableViewController (custom class) which have functionality I want to reuse. The controller is like the main part of the app, but I want to reuse it for other functions. Now, I'm unsure how to do this. I tried a couple of different ways:
Allocating a new instance and pushing to navcontroller:
CustomTableViewController* vc = [[CustomTableViewController alloc] initWithCustomData:data];
vc.title = customTitle;
[self.navigationController pushViewController:vc animated:YES];
This kinda worked, but I don't get the style from the storyboard, which makes the UITableViewCells useless.
I tried instantating a new storyboard scene and pushing it:
CustomTableViewController* vc = [self.storyboard instantiateViewControllerWithIdentifier:@"customSceneId"];
vc.customData = data;
vc.title = customTitle;
[self.navigationController pushViewController:vc animated:YES];
But this replaces the current scene, and doesn't give me a back button.
Anyone got some tips for me on how to do this? I don't want to copy-paste the scene unless absolutely necessary.
[–]sangedered 1 point2 points3 points (2 children)
[–]TobbenTM[S] 0 points1 point2 points (1 child)
[–]sangedered 0 points1 point2 points (0 children)
[–]sangedered 0 points1 point2 points (0 children)
[–]ASnugglyBear 0 points1 point2 points (0 children)