Browse Source

set badge color only if available (>=10) (#2068)

Ran Greenberg 7 years ago
parent
commit
b547f8aaeb
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      ios/RCCTabBarController.m

+ 4
- 1
ios/RCCTabBarController.m View File

@@ -265,7 +265,10 @@
265 265
       {
266 266
         NSString *badgeColor = actionParams[@"badgeColor"];
267 267
         UIColor *color = badgeColor != (id)[NSNull null] ? [RCTConvert UIColor:badgeColor] : nil;
268
-        viewController.tabBarItem.badgeColor = color;
268
+        
269
+        if (viewController.tabBarItem respondsToSelector:@selector(badgeColor)) {
270
+          viewController.tabBarItem.badgeColor = color;
271
+        }
269 272
         viewController.tabBarItem.badgeValue = [NSString stringWithFormat:@"%@", badge];
270 273
       }
271 274
     }