react-native-navigation的迁移库

RNNBottomTabsOptions.m 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #import "RNNBottomTabsOptions.h"
  2. #import "RNNTabBarController.h"
  3. extern const NSInteger BLUR_TOPBAR_TAG;
  4. @implementation RNNBottomTabsOptions
  5. - (void)applyOn:(UIViewController *)viewController {
  6. if (self.currentTabIndex) {
  7. [viewController.tabBarController setSelectedIndex:[self.currentTabIndex unsignedIntegerValue]];
  8. }
  9. if (self.currentTabId) {
  10. [(RNNTabBarController*)viewController.tabBarController setSelectedIndexByComponentID:self.currentTabId];
  11. }
  12. if (self.hidden) {
  13. [((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:[self.hidden boolValue] animated:[self.animateHide boolValue]];
  14. }
  15. if (self.testID) {
  16. viewController.tabBarController.tabBar.accessibilityIdentifier = self.testID;
  17. }
  18. if (self.drawUnder) {
  19. if ([self.drawUnder boolValue]) {
  20. viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
  21. } else {
  22. viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
  23. }
  24. }
  25. [self resetOptions];
  26. }
  27. - (void)resetOptions {
  28. self.currentTabId = nil;
  29. self.currentTabIndex = nil;
  30. }
  31. @end