react-native-navigation的迁移库

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #import "RNNLayoutNode.h"
  2. @implementation RNNLayoutNode
  3. +(instancetype)create:(NSDictionary *)json
  4. {
  5. RNNLayoutNode* node = [RNNLayoutNode new];
  6. node.type = json[@"type"];
  7. node.nodeId = json[@"id"];
  8. node.data = json[@"data"];
  9. node.children = json[@"children"];
  10. return node;
  11. }
  12. -(BOOL)isComponent
  13. {
  14. return [self.type isEqualToString:@"Component"];
  15. }
  16. -(BOOL)isExternalComponent
  17. {
  18. return [self.type isEqualToString:@"ExternalComponent"];
  19. }
  20. -(BOOL)isStack
  21. {
  22. return [self.type isEqualToString:@"Stack"];
  23. }
  24. -(BOOL)isTabs
  25. {
  26. return [self.type isEqualToString:@"BottomTabs"];
  27. }
  28. -(BOOL)isTopTabs
  29. {
  30. return [self.type isEqualToString:@"TopTabs"];
  31. }
  32. -(BOOL)isSideMenuRoot
  33. {
  34. return [self.type isEqualToString:@"SideMenuRoot"];
  35. }
  36. -(BOOL)isSideMenuLeft
  37. {
  38. return [self.type isEqualToString:@"SideMenuLeft"];
  39. }
  40. -(BOOL)isSideMenuRight
  41. {
  42. return [self.type isEqualToString:@"SideMenuRight"];
  43. }
  44. -(BOOL)isSideMenuCenter
  45. {
  46. return [self.type isEqualToString:@"SideMenuCenter"];
  47. }
  48. @end