Greg
Greg

Reputation: 707

Segue to new View Controller from button on table view navigation bar

I would like to add a button on navigation bar of a UITableViewController that will segue to a new UIViewController.

Control-dragging a button from one VC to a new VC (VC-A to VC-B) works perfectly, even providing a button on VC-B's navigation bar to return to VC-A.

However, putting a button on the navigation bar of a Table VC, then control-dragging it to the new VC (TVC-C to VC-D), appears to do the same thing, providing the return button on VC-D in storyboard, but when I run it, it does not open VC-D.

I noticed that putting a button on the Table View's navigation bar turns it into a Bar Button, whereas placing one on a VC does not. Does this have something to do with it? How do I get around that?

(Using XCode 10, Swift 4)

Upvotes: 0

Views: 79

Answers (1)

Greg
Greg

Reputation: 707

Instead of a Table View Controller, I used a TableView on a View Controller.

Upvotes: 1

Related Questions