UINavigationController flow on issues #2
Second issue I ran into after implementing a UINavigationController was that code running off the old Banner class Back Button was not being run.
I overlooked this completely but luckily one of the TestFlight testers picked it up. Was actually Jon the previous developer.
So the old system used a Banner class to manually place a navigation bar at the top of the screen. Depending on the screen determined what buttons would be placed inside the banner. Obviously these custom buttons had actions.
The one particular action was the Banner Back button on the Match Scoring Screen that called an UnwindHandler(). This handler checked if a game was running and if so prompted asking if the suer was sure they want to exit and if so saved the current game stats, cleaned up the database stuff and safety dismissed the view controller.
My update did none of that.
It was a fairly simple fix. I added the call to UnwindHandler() and updated the alert code to a new shift syntax just to keep things updated.
It fixed the issue.
Things to remember when converting over to a UINavigationController:
- Check if any views are relying on the old banner system you use for their auto layout constraints and update them as necessary.
- Check if there are any old buttons that have actions that perform core application functions and it so make sure your new UINavigationBar button are either calling the same methods in their action or are doing what’s needed in a new action.