lib/ProMotion/screen/screen_module.rb in ProMotion-2.0.1 vs lib/ProMotion/screen/screen_module.rb in ProMotion-2.1.0.beta1

- old
+ new

@@ -9,13 +9,13 @@ attr_accessor :parent_screen, :first_screen, :modal, :split_screen def screen_init(args = {}) check_ancestry resolve_title - tab_bar_setup - set_attributes self, args + apply_properties(args) add_nav_bar(args) if args[:nav_bar] + tab_bar_setup try :screen_setup try :on_init PM.logger.deprecated "In #{self.class.to_s}, #on_create has been deprecated and removed. Use #screen_init instead." if respond_to?(:on_create) end @@ -143,9 +143,14 @@ def frame return self.view_or_self.frame end private + + def apply_properties(args) + reserved_args = [ :nav_bar, :hide_nav_bar, :hide_tab_bar, :animated, :close_all, :in_tab, :in_detail, :in_master, :to_screen ] + set_attributes self, args.dup.delete_if { |k,v| reserved_args.include?(k) } + end def tab_bar_setup self.tab_bar_item = self.class.send(:get_tab_bar_item) self.refresh_tab_bar_item if self.tab_bar_item end