motion/core/app.rb in bubble-wrap-1.1.3 vs motion/core/app.rb in bubble-wrap-1.1.4
- old
+ new
@@ -88,10 +88,14 @@
def identifier
NSBundle.mainBundle.bundleIdentifier
end
+ def version
+ NSBundle.mainBundle.infoDictionary['CFBundleVersion']
+ end
+
# Return application frame
def frame
UIScreen.mainScreen.applicationFrame
end
@@ -108,10 +112,15 @@
# the Application object.
def shared
UIApplication.sharedApplication
end
+ # the Application Window
+ def window
+ UIApplication.sharedApplication.keyWindow || UIApplication.sharedApplication.windows[0]
+ end
+
# @return [NSLocale] locale of user settings
def current_locale
languages = NSLocale.preferredLanguages
if languages.count > 0
return NSLocale.alloc.initWithLocaleIdentifier(languages.first)
@@ -120,6 +129,6 @@
end
end
end
end
-::App = BubbleWrap::App
+::App = BubbleWrap::App unless defined?(::App)