Merge pull request #5 from plivesey/master

Fixing a bug where finding the right window wouldn't work.
This commit is contained in:
Matt Coneybeare
2014-11-25 16:15:42 -05:00
+6 -3
View File
@@ -1597,16 +1597,19 @@ 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 {
if candidateWindow.windowLevel == UIWindowLevelNormal {
window = candidateWindow
break break
} }
} }
} }
}
for subView in window.subviews { for subView in window.subviews {
var nextResponder: UIResponder? = subView.nextResponder() var nextResponder: UIResponder? = subView.nextResponder()