Skip to content

Commit

Permalink
Adding badging to TabBar Class
Browse files Browse the repository at this point in the history
  • Loading branch information
Silas J. Matson committed Aug 27, 2012
1 parent c2175bd commit fb395c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/motion-tab/tab_bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def createTabBarControllerFromData(data)
tab[:badgeNumber] = 0 unless tab[:badgeNumber]

viewController = tab[:viewController].alloc.init
viewController.tabBarItem = tabBarIcon(tab[:systemIcon], tab[:badgeNumber]) if tab[:systemIcon]
viewController.tabBarItem = tabBarIcon(tab[:systemIcon], tab[:tag]) if tab[:systemIcon]
viewController.tabBarItem.badgeValue = tab[:badgeNumber].to_i.to_s if tab[:badgeNumber] && tab[:badgeNumber].to_i > 0

if tab[:navigationController]
controller = UINavigationController.alloc.initWithRootViewController(viewController)
Expand Down

0 comments on commit fb395c8

Please sign in to comment.