I have a UIViewController that is created via instantiateViewControllerWithIdentifier. In that controller, the user may enter some text that I need to validate before saving. There is a back button that the user clicks and that will trigger the save. But if there is an error, I will not allow the user to go back. What is the best practice for this? I read stackoverflow and the solution seems to be overriding UINavigationController, which I think is some sort of hack. I cannot put the code in willMovetoParentViewController since there is no return of true or false. It will still proceed.
Asked
Active
Viewed 119 times
1
-
You have to create custom back button and set it to the UINavigationBar. – Nirav D Jun 11 '16 at 11:19