Issue
I would like to perform some actions when a user presses the “Back” button on my Navigation Controller. Is there a Swift function that is called when this happens?
Solution
override func viewWillDisappear(animated: Bool) {
// Do Your Lines of Code ...
}
Everytime when back button or Done is pressed or a view is popped out this function is called.. you need to override this..
Answered By – Abdul Waheed
Answer Checked By – Clifford M. (BugsFixing Volunteer)