thellimist / EZAlertController

Easy Swift UIAlertController
MIT License
366 stars 50 forks source link

Presenting on keyWindow.rootViewController is not a good idea #7

Closed LeoNatan closed 8 years ago

LeoNatan commented 8 years ago

This is a very naive way to look at windows and controllers in this day and age. There are many cases where this assumption is incorrect. Another problem would be calling your alert method multiple times.

The more correct way would be to display the alert controller on top of a clear root controller in a window of its own. Then you enter into the territory of managing multiple alerts displayed one after the other. And lo and behold, your have implemented _UIAlertControllerShimPresenter and _UIAlertControllerShimPresenterWindow, the internals of the now deprecated UIAlertView.

Esqarrouth commented 8 years ago

Which case will this be incorrect?

Can you give an example of code for the correct way that you are suggesting?

thellimist commented 8 years ago

The issue was not updated for 10 months. Closing.