react-native-navigation的迁移库

RNNLayoutNode.m 889B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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)isStack
  17. {
  18. return [self.type isEqualToString:@"Stack"];
  19. }
  20. -(BOOL)isTabs
  21. {
  22. return [self.type isEqualToString:@"BottomTabs"];
  23. }
  24. -(BOOL)isTopTabs
  25. {
  26. return [self.type isEqualToString:@"TopTabs"];
  27. }
  28. -(BOOL)isSideMenuRoot
  29. {
  30. return [self.type isEqualToString:@"SideMenuRoot"];
  31. }
  32. -(BOOL)isSideMenuLeft
  33. {
  34. return [self.type isEqualToString:@"SideMenuLeft"];
  35. }
  36. -(BOOL)isSideMenuRight
  37. {
  38. return [self.type isEqualToString:@"SideMenuRight"];
  39. }
  40. -(BOOL)isSideMenuCenter
  41. {
  42. return [self.type isEqualToString:@"SideMenuCenter"];
  43. }
  44. @end