cordux
cordux copied to clipboard
UIAlertController does not call `didMove(toParentViewController:)`
UIAlertController seems to do strange stuff inside, it does not call didMove(toParentViewController:) when showing/dismissing. Any ideas on how to keep the navigation state in sync?
For alerts you can use the handler for each button to update the state. So in addition to taking the action that might be confirmed, you would also use store.setRoute at that point.
I'd rather have the class who configures the actions not know about state handling, that would tangle up my factory methods. Maybe I can use viewDidDisappear if I assume nothing gets presented on top of the UIAlertController (which might technically be possible, but not very practical).