Class: MotionPrime::TabBarController
- Inherits:
-
UITabBarController
- Object
- UITabBarController
- MotionPrime::TabBarController
- Defined in:
- motion-prime/screens/controllers/tab_bar_controller.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.new(screens, global_options = {}) ⇒ Object
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, = {}) controller = alloc.init view_controllers = [] screens.each_with_index do |, index| if .is_a?(Hash) screen = (.deep_merge(), tag: index) else screen = screen.tabBarItem.tag = index end screen.send(:on_screen_load) if screen.respond_to?(:on_screen_load) screen. if screen.respond_to?(:wrap_in_navigation) screen. = controller.weak_ref if screen.respond_to?(:tab_bar=) view_controllers << screen.main_controller.strong_ref end controller.viewControllers = view_controllers controller end |
Instance Method Details
#dealloc ⇒ Object
34 35 36 37 38 |
# File 'motion-prime/screens/controllers/tab_bar_controller.rb', line 34 def dealloc Prime.logger. :tab_bar, self clear_instance_variables super end |
#open_tab(tab) ⇒ Object
26 27 28 29 30 31 32 |
# File 'motion-prime/screens/controllers/tab_bar_controller.rb', line 26 def open_tab(tab) controller = viewControllers[tab] if controller self.selectedViewController = controller end controller end |