There is a willmoveToParentViewController
to catch back event between view controllers.
I have form . when user click back
button I want to check if he made changes and give him warning about lost his data.
How can I stop back event ?
There is a willmoveToParentViewController
to catch back event between view controllers.
I have form . when user click back
button I want to check if he made changes and give him warning about lost his data.
How can I stop back event ?
you can present an alert view controller that eseentially freezes any further action until the user deals with the alert view. Perhaps add an "OK" and "Cancel" button, OK goes back, cancel stays. Make the body say 'Warning, unsaved changes will be lost" or something.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/