How to return back to previous view controller programmatically? I found this answer, but there is an example that demonstrate how to go back if we have navigation stack:
Best answer is this: _ = navigationController?.popViewController(animated: true)
Taken from here: https://stackoverflow.com/a/28761084/2173368