Fixing a bug where finding the right window wouldn't work.

Now, even if you call rateApp() from a UIActionSheet, it will actually present the modal.
This commit is contained in:
Peter Livesey
2014-11-23 12:30:33 -08:00
parent 4e077db6d2
commit 4e92562547

View File

@@ -1597,13 +1597,16 @@ public class Manager : ArmchairManager {
}
private func getRootViewController() -> UIViewController? {
if let window = UIApplication.sharedApplication().keyWindow {
if var window = UIApplication.sharedApplication().keyWindow {
if window.windowLevel != UIWindowLevelNormal {
var windows: NSArray = UIApplication.sharedApplication().windows
for window in windows {
if window.windowLevel == UIWindowLevelNormal {
break
for candidateWindow in windows {
if let candidateWindow = candidateWindow as? UIWindow {
if candidateWindow.windowLevel == UIWindowLevelNormal {
window = candidateWindow
break
}
}
}
}