In your case, I think your are not dismissing the view.
Can you show me the code, that how you are moving to second one from first.
Example : If using this
self.present(ViewController, animated: false, completion: nil)
then you need to add below code on back button or submit whatever for coming back.
dismiss(animated: false, completion: nil)
Hope this may help.