lib/ProMotion/screen/nav_bar_module.rb in ProMotion-2.4.2 vs lib/ProMotion/screen/nav_bar_module.rb in ProMotion-2.5.0.beta1

- old
+ new

@@ -51,18 +51,25 @@ end alias_method :set_toolbar_buttons, :set_toolbar_items alias_method :set_toolbar_button, :set_toolbar_items def add_nav_bar(args = {}) + args = self.class.get_nav_bar.merge(args) + return unless args[:nav_bar] self.navigationController ||= begin self.first_screen = true if self.respond_to?(:first_screen=) nav = (args[:nav_controller] || NavigationController).alloc.initWithRootViewController(self) nav.setModalTransitionStyle(args[:transition_style]) if args[:transition_style] nav.setModalPresentationStyle(args[:presentation_style]) if args[:presentation_style] nav end self.navigationController.toolbarHidden = !args[:toolbar] unless args[:toolbar].nil? - self.navigationController.setNavigationBarHidden(args[:hide_nav_bar], animated: false) unless args[:hide_nav_bar].nil? + end + + def view_will_appear(animated) + if @screen_options && !@screen_options[:hide_nav_bar].nil? + self.navigationController.setNavigationBarHidden(@screen_options[:hide_nav_bar], animated: false) + end end private def create_toolbar_button(args = {})