mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-03-18 23:44:20 +01:00
Merge pull request #5 from plivesey/master
Fixing a bug where finding the right window wouldn't work.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user