swift go back to previous view controller code example
Example 1: swift go back to previous view controller
if let navController = self.navigationController {
navController.popViewController(animated: true)
}
Example 2: swift go back to previous view controller
func backAction(){
//print("Back Button Clicked")
dismiss(animated: true, completion: nil)
}