Swift 4
there's two ways to return/back to the previous ViewController :
self.navigationController?.pushViewController(yourViewController, animated: true)
in this case you need to use self.navigationController?.popViewController(animated: true)
self.present(yourViewController, animated: true, completion: nil)
in this case you need to use self.dismiss(animated: true, completion: nil)
In the first case , be sure that you embedded your ViewController to a navigationController in your storyboard