react-native-navigation的迁移库

UITabBarController+RNNUtils.m 557B

123456789101112131415161718192021
  1. #import "UITabBarController+RNNUtils.h"
  2. #import "UIView+Utils.h"
  3. @implementation UITabBarController (RNNUtils)
  4. - (UIView *)getTabView:(int)tabIndex {
  5. int index = 0;
  6. for (UIView *view in [[self tabBar] subviews]) {
  7. if ([NSStringFromClass([view class]) isEqualToString:@"UITabBarButton"]) {
  8. if (index == tabIndex) return view;
  9. index++;
  10. }
  11. }
  12. return nil;
  13. }
  14. - (UIView *)getTabIcon:(int)tabIndex {
  15. UIView *tab = [self getTabView:tabIndex];
  16. return [tab findChildByClass:[UIImageView class]];
  17. }
  18. @end