DemoViewController.swift: Adds an optional closure that is called right before the AlertController is dismissed. This is intended as an entry point to call animations or any UI update on the container controller.
Note: I used shouldDismissHandler as an entry point to update the UI of the controller that presented the alert. The idea was to update the UI right in the moment the AlertController started to animate its way out but shouldDismissHandler is not called when an outside tap is performed, only on actions and outsideTapHandler is called after the animation is done. I thought that it was faster and cleaner to just have a closure like outsideTapHandler called right before the alert is dismissed by any reason.
Note: I used shouldDismissHandler as an entry point to update the UI of the controller that presented the alert. The idea was to update the UI right in the moment the AlertController started to animate its way out but shouldDismissHandler is not called when an outside tap is performed, only on actions and outsideTapHandler is called after the animation is done. I thought that it was faster and cleaner to just have a closure like outsideTapHandler called right before the alert is dismissed by any reason.