Skip to content

Commit

Permalink
[BottomNavigation] Fix example using iOS 10 API (#2357)
Browse files Browse the repository at this point in the history
The typical use example uses an iOS 10-only API and needs to check for the
selector to be present.

Closes #2355
  • Loading branch information
Robert Moore authored and Junius Gunaratne committed Nov 8, 2017
1 parent d8919eb commit 798f447
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ - (void)commonBottomNavigationTypicalUseExampleInit {
tag:0];
tabBarItem5.badgeValue = @"999+";
#if defined(__IPHONE_10_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0)
tabBarItem5.badgeColor = [MDCPalette cyanPalette].accent700;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
if ([tabBarItem5 respondsToSelector:@selector(badgeColor)]) {
tabBarItem5.badgeColor = [MDCPalette cyanPalette].accent700;
}
#pragma clang diagnostic pop
#endif
_bottomNavBar.items = @[ tabBarItem1, tabBarItem2, tabBarItem3, tabBarItem4, tabBarItem5 ];
_bottomNavBar.selectedItem = tabBarItem2;
Expand Down

0 comments on commit 798f447

Please sign in to comment.