Before showing the alert view it is added on the first object found in [[UIApplication sharedApplication] windows].
Starting with iOS 9 Apple introduced a feature called Picture in Picture; when this feature is enabled
the first found window will be an object of type PGHostedWindow which holds the popup view of the PiP feature (note that thiss happens only on iPads).
Trying to add the alert view on that window will make the alert view to not appear at all. This pull request fixes that by looking on the first object in [[UIApplication sharedApplication] windows] which is exactly a type of UIWindow class.
Before showing the alert view it is added on the first object found in [[UIApplication sharedApplication] windows]. Starting with iOS 9 Apple introduced a feature called Picture in Picture; when this feature is enabled the first found window will be an object of type
PGHostedWindow
which holds the popup view of the PiP feature (note that thiss happens only on iPads). Trying to add the alert view on that window will make the alert view to not appear at all. This pull request fixes that by looking on the first object in [[UIApplication sharedApplication] windows] which is exactly a type ofUIWindow
class.