Before this change, a "SheetHost" view controller might not be presented
if the presenter already presented another view controller. This might
have happened when a sheet will be presented due to a state change
originating from an app state, rather from a user intent, and when there
is already a presented view or a presented alert.
This change walks the presented view controller list until it finds a
view controller which has no presented view controller and uses this as
the presenter. As a result, a sheet now presents on top of any other
presented view, even on top of alerts.
Before this change, a "SheetHost" view controller might not be presented if the presenter already presented another view controller. This might have happened when a sheet will be presented due to a state change originating from an app state, rather from a user intent, and when there is already a presented view or a presented alert.
This change walks the presented view controller list until it finds a view controller which has no presented view controller and uses this as the presenter. As a result, a sheet now presents on top of any other presented view, even on top of alerts.