lib/ProMotion/screen/nav_bar_module.rb in ProMotion-2.1.0 vs lib/ProMotion/screen/nav_bar_module.rb in ProMotion-2.2.0

- old
+ new

@@ -33,11 +33,15 @@ PM.logger.deprecated "set_nav_bar_right_button and set_nav_bar_left_button have been removed. Use set_nav_bar_button :right/:left instead." end alias_method :set_nav_bar_right_button, :set_nav_bar_left_button def set_toolbar_items(buttons = [], animated = true) - self.toolbarItems = Array(buttons).map{|b| b.is_a?(UIBarButtonItem) ? b : create_toolbar_button(b) } - navigationController.setToolbarHidden(false, animated:animated) + if buttons + self.toolbarItems = Array(buttons).map{|b| b.is_a?(UIBarButtonItem) ? b : create_toolbar_button(b) } + navigationController.setToolbarHidden(false, animated:animated) + else + navigationController.setToolbarHidden(true, animated:animated) + end end alias_method :set_toolbar_buttons, :set_toolbar_items alias_method :set_toolbar_button, :set_toolbar_items def add_nav_bar(args = {})