lib/ProMotion/delegate/delegate_module.rb in ProMotion-1.0.4 vs lib/ProMotion/delegate/delegate_module.rb in ProMotion-1.1.0.rc1

- old
+ new

@@ -1,10 +1,9 @@ module ProMotion module DelegateModule - include ProMotion::Tabs - include ProMotion::SplitScreen if NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2") # Only with iPad + include ProMotion::SplitScreen if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad include ProMotion::DelegateNotifications attr_accessor :window, :aps_notification, :home_screen def application(application, willFinishLaunchingWithOptions:launch_options) @@ -36,10 +35,14 @@ def applicationWillTerminate(application) on_unload if respond_to?(:on_unload) end + def application(application, openURL: url, sourceApplication:source_app, annotation: annotation) + on_open_url({ url: url, source_app: source_app, annotation: annotation }) if respond_to?(:on_open_url) + end + def app_delegate self end def app_window @@ -56,10 +59,11 @@ self.home_screen = screen self.window ||= self.ui_window.alloc.initWithFrame(UIScreen.mainScreen.bounds) self.window.rootViewController = (screen.navigationController || screen) + self.window.tintColor = self.class.send(:get_tint_color) if self.window.respond_to?("tintColor=") self.window.makeKeyAndVisible screen end alias :open :open_screen @@ -91,9 +95,19 @@ { fade: UIStatusBarAnimationFade, slide: UIStatusBarAnimationSlide, none: UIStatusBarAnimationNone }[opt] || UIStatusBarAnimationNone + end + + def tint_color(c) + @tint_color = c + end + def tint_color=(c) + @tint_color = c + end + def get_tint_color + @tint_color || nil end end def self.included(base)