lib/ProMotion/tabs/tabs.rb in ProMotion-2.2.2 vs lib/ProMotion/tabs/tabs.rb in ProMotion-2.3.0
- old
+ new
@@ -2,10 +2,11 @@
module Tabs
attr_accessor :tab_bar, :tab_bar_item
def open_tab_bar(*screens)
self.tab_bar = PM::TabBarController.new(screens)
+ self.tab_bar.pm_tab_delegate = WeakRef.new(self)
delegate = self.respond_to?(:open_root_screen) ? self : UIApplication.sharedApplication.delegate
delegate.open_root_screen(self.tab_bar)
self.tab_bar
@@ -65,9 +66,10 @@
tab_bar_item = UITabBarItem.alloc.initWithTabBarSystemItem(map_tab_symbol(tab[:system_item]), tag: current_tag) if tab[:system_item]
tab_bar_item = create_tab_bar_item_custom(title, tab[:item], current_tag) if tab[:item]
tab_bar_item.badgeValue = tab[:badge_number].to_s unless tab[:badge_number].nil? || tab[:badge_number] <= 0
+ tab_bar_item.imageInsets = tab[:image_insets] if tab[:image_insets]
tab_bar_item
end
def current_tag