mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-06-04 06:39:35 +08:00
@@ -1,7 +1,7 @@
|
||||
module ProMotion
|
||||
class Delegate
|
||||
include ProMotion::ScreenTabs
|
||||
include ProMotion::SplitScreen if NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2")
|
||||
include ProMotion::SplitScreen if NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2") # Only with iPad
|
||||
attr_accessor :window
|
||||
|
||||
def application(application, didFinishLaunchingWithOptions:launch_options)
|
||||
@@ -11,8 +11,6 @@ module ProMotion
|
||||
|
||||
on_load(application, launch_options)
|
||||
|
||||
open_home_screen if has_home_screen && self.window.nil?
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ module ProMotion
|
||||
def push_view_controller(vc, nav_controller=nil)
|
||||
Console.log(" You need a nav_bar if you are going to push #{vc.to_s} onto it.", withColor: Console::RED_COLOR) unless self.navigation_controller
|
||||
nav_controller ||= self.navigation_controller
|
||||
vc.first_screen = false if vc.respond_to?(:first_screen=)
|
||||
nav_controller.pushViewController(vc, animated: true)
|
||||
end
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ module ProMotion
|
||||
split.viewControllers = [ master_main, detail_main ]
|
||||
split.delegate = self
|
||||
|
||||
[ master, detail ].map { |s| s.split_screen = split if s.respond_to?(:split_screen=) }
|
||||
|
||||
split
|
||||
end
|
||||
|
||||
@@ -15,14 +17,9 @@ module ProMotion
|
||||
master = master.new if master.respond_to?(:new)
|
||||
detail = detail.new if detail.respond_to?(:new)
|
||||
|
||||
split = split_screen_controller(master, detail)
|
||||
[ master, detail ].map { |s| s.on_load if s.respond_to?(:on_load) }
|
||||
|
||||
[master, detail].each do |s|
|
||||
s.split_screen = split if s.respond_to?("split_screen=")
|
||||
s.on_load if s.respond_to?(:on_load)
|
||||
end
|
||||
|
||||
split
|
||||
split_screen_controller master, detail
|
||||
end
|
||||
|
||||
def open_split_screen(master, detail, args={})
|
||||
|
||||
@@ -18,8 +18,8 @@ module ProMotion
|
||||
end
|
||||
|
||||
self.add_nav_bar if args[:nav_bar]
|
||||
self.table_setup if self.respond_to?(:table_setup)
|
||||
self.on_init if self.respond_to?(:on_init)
|
||||
self.table_setup if self.respond_to?(:table_setup)
|
||||
self
|
||||
end
|
||||
|
||||
@@ -55,8 +55,10 @@ module ProMotion
|
||||
end
|
||||
|
||||
def add_nav_bar
|
||||
self.navigation_controller = NavigationController.alloc.initWithRootViewController(self)
|
||||
self.first_screen = true
|
||||
self.navigation_controller ||= begin
|
||||
self.first_screen = true if self.respond_to?(:first_screen=)
|
||||
NavigationController.alloc.initWithRootViewController(self)
|
||||
end
|
||||
end
|
||||
|
||||
def set_nav_bar_right_button(title, args={})
|
||||
|
||||
Reference in New Issue
Block a user