mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-06-01 02:10:22 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user