mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-04-25 10:18:44 +02:00
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:
@@ -1597,13 +1597,16 @@ public class Manager : ArmchairManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func getRootViewController() -> UIViewController? {
|
private func getRootViewController() -> UIViewController? {
|
||||||
if let window = UIApplication.sharedApplication().keyWindow {
|
if var window = UIApplication.sharedApplication().keyWindow {
|
||||||
|
|
||||||
if window.windowLevel != UIWindowLevelNormal {
|
if window.windowLevel != UIWindowLevelNormal {
|
||||||
var windows: NSArray = UIApplication.sharedApplication().windows
|
var windows: NSArray = UIApplication.sharedApplication().windows
|
||||||
for window in windows {
|
for candidateWindow in windows {
|
||||||
if window.windowLevel == UIWindowLevelNormal {
|
if let candidateWindow = candidateWindow as? UIWindow {
|
||||||
break
|
if candidateWindow.windowLevel == UIWindowLevelNormal {
|
||||||
|
window = candidateWindow
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user