react-native-navigation的迁移库

1234567891011121314151617181920212223242526272829
  1. #import "UIView+Utils.h"
  2. #import <React/RCTImageView.h>
  3. #import <React/RCTTextView.h>
  4. @implementation UIView (Utils)
  5. - (UIView *)findChildByClass:(id)clazz {
  6. for (UIView *child in [self subviews]) {
  7. if ([child isKindOfClass:clazz]) return child;
  8. }
  9. return nil;
  10. }
  11. - (void)layout:(CGFloat)p {
  12. }
  13. - (ViewType)viewType {
  14. if ([self isKindOfClass:[RCTImageView class]]) {
  15. return ViewTypeImage;
  16. } else if ([self isKindOfClass:[RCTTextView class]]) {
  17. return ViewTypeText;
  18. }
  19. return ViewTypeOther;
  20. }
  21. @end