Moved the rest of the Delegate methods into the helper. Added home_screen accessor (only available if you use open, not open_tab_bar)

This commit is contained in:
Jamon Holmgren
2013-05-31 17:31:47 -07:00
parent 45b3bcade8
commit 3eb9fc65f0
2 changed files with 23 additions and 22 deletions

View File

@@ -6,26 +6,6 @@ module ProMotion
include DelegateHelper
include DelegateNotifications
attr_accessor :window, :aps_notification
def application(application, didFinishLaunchingWithOptions:launch_options)
apply_status_bar
on_load application, launch_options
check_for_push_notification launch_options
true
end
def applicationWillTerminate(application)
on_unload if respond_to?(:on_unload)
end
end
class AppDelegateParent < Delegate

View File

@@ -1,6 +1,27 @@
module ProMotion
module DelegateHelper
attr_accessor :window, :aps_notification, :home_screen
def application(application, didFinishLaunchingWithOptions:launch_options)
apply_status_bar
on_load application, launch_options
check_for_push_notification launch_options
true
end
def applicationWillTerminate(application)
on_unload if respond_to?(:on_unload)
end
def app_delegate
self
end
@@ -18,7 +39,7 @@ module ProMotion
screen = screen.new if screen.respond_to?(:new)
screen.send(:on_load) if screen.respond_to?(:on_load)
@home_screen = screen
self.home_screen = screen
self.window ||= self.ui_window.alloc.initWithFrame(UIScreen.mainScreen.bounds)
self.window.rootViewController = screen.pm_main_controller
@@ -65,4 +86,4 @@ module ProMotion
end
end
end
end