I am making a simple game that presents an alert controller to notify the player when they have won or lost a battle. Sometimes there are simultaneous attacks such that both combatants lose health at the same time and are slain. The alert controllers are each in separate if statements, but when both are called I was hoping they would both be called sequentially and after dismissing the first one the second one would be presented, but instead I get the following error message:
Warning: Attempt to present on which is already presenting
I looked for a solution and saw recommendations for having the first alert controller call the second, but I didn't want to use the solution since it is rare that both alert controllers are called at the same time.
Is there a better solution for handling this or would my best bet be to reconfigure the code so that one alert controller calls the other or to stop using alert controllers?