Spiff
Spiff

Reputation: 913

uinavigation controller segue within static table cell

I am creating an app that has a static uitableview with three large cells. I would like each cell to have its own navigation controller that operates within the cell. When I associate a navigation controller with a cell (via edit/embed in/navigation controller) I get a situation where a segue from a table cell results in the entire tableview being replaced rather than the cell view. Is there a way (ideally via storyboards) that in merely replace the view controller within the cell. It is not a hard requirement that the table be static. Thanks.

Upvotes: 0

Views: 135

Answers (1)

GoZoner
GoZoner

Reputation: 70265

You need to

  1. rethink your UI flow to avoid putting a UINavigationController inside a UITableViewCell. As you've seen, a navigation controller expects to be the top controller in a window's hierarchy and will install itself to be such,
  2. implement your own navigation-controller-like functionality as a custom UITableViewCell.

#1 really is the option you should take.

Consider using a UITabBarController with three tabs, one for each of the UINavigationControllers of your table cells.

Upvotes: 1

Related Questions