3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'motion-prime/screens/controllers/tab_bar_controller.rb', line 3
def self.new(screens, global_options = {})
controller = alloc.init
view_controllers = []
screens.each_with_index do |options, index|
if options.is_a?(Hash)
screen = init_screen_with_options(global_options.deep_merge(options), tag: index)
else
screen = options
screen.tabBarItem.tag = index
end
screen.send(:on_screen_load) if screen.respond_to?(:on_screen_load)
screen.wrap_in_navigation if screen.respond_to?(:wrap_in_navigation)
screen.tab_bar = controller.weak_ref if screen.respond_to?(:tab_bar=)
view_controllers << screen.main_controller.strong_ref
end
controller.viewControllers = view_controllers
controller
end
|