Christian Christian - 3 months ago 34x
Swift Question

Programmatically go back to previous ViewController in Swift

I send the user over to a page on a button click. This page is a UITableViewController.

Now if the user taps on a cell, I would like to push him back to the previous page.

I thought about something like

but this seems to be a bad idea.

What is the correct way to do it?


If you want to go back to the previous view controller


If you want to go back to the root view controller