lib/ios/sugarcube-repl/repl.rb in sugarcube-3.4.0 vs lib/ios/sugarcube-repl/repl.rb in sugarcube-3.4.1
- old
+ new
@@ -2,14 +2,13 @@
class << Repl
def window(index=nil)
if index
UIApplication.sharedApplication.windows[index]
+ elsif UIApplication.sharedApplication.keyWindow
+ UIApplication.sharedApplication.keyWindow
else
- (
- UIApplication.sharedApplication.keyWindow ||
- UIApplication.sharedApplication.windows[0]
- )
+ UIApplication.sharedApplication.windows.select { |window| window.subviews.count > 0 }.first
end
end
def root
window.rootViewController