Reputation: 1695
I'm writing Unit tests for my app and there seems to be a problem with getting shown UIAlertView.
On iOS 7, this used to work:
UIAlertView* alertView = [NSClassFromString(@"_UIAlertManager") performSelector:@selector(topMostAlert)]
but this doesn't work on iOS 8.
Is there a way visible UIAlertView can be retrieved on iOS 8?
Upvotes: 1
Views: 871
Reputation: 23
Maybe it because iOS 8 use UIAlertController instead of UIAlertView.
Apple Developers Library "UIAlertController"
Upvotes: 0
Reputation: 1174
UIAlertView and UIActionSheet is combined in a class called UIAlertController in ios8. Kindly check the Apple Document
From Apple Doc
A UIAlertController object displays an alert message to the user. This class replaces the UIActionSheet and UIAlertView classes for displaying alerts. After configuring the alert controller with the actions and style you want, present it using the presentViewController:animated:completion: method.
Upvotes: 4