react-native-navigation的迁移库

RNNNavigationOptions.m 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #import "RNNNavigationOptions.h"
  2. #import <React/RCTConvert.h>
  3. #import "RNNStackController.h"
  4. #import "RNNBottomTabsController.h"
  5. #import "RNNTopBarOptions.h"
  6. #import "RNNSideMenuController.h"
  7. #import "RNNComponentViewController.h"
  8. #import "RNNSplitViewController.h"
  9. #import "RNNNavigationButtons.h"
  10. #import "RNNSplitViewOptions.h"
  11. #import "UIViewController+RNNOptions.h"
  12. #import "UINavigationController+RNNOptions.h"
  13. @implementation RNNNavigationOptions
  14. - (instancetype)initWithDict:(NSDictionary *)dict {
  15. self = [super init];
  16. self.topBar = [[RNNTopBarOptions alloc] initWithDict:dict[@"topBar"]];
  17. self.bottomTabs = [[RNNBottomTabsOptions alloc] initWithDict:dict[@"bottomTabs"]];
  18. self.bottomTab = [[RNNBottomTabOptions alloc] initWithDict:dict[@"bottomTab"]];
  19. self.topTabs = [[RNNTopTabsOptions alloc] initWithDict:dict[@"topTabs"]];
  20. self.topTab = [[RNNTopTabOptions alloc] initWithDict:dict[@"topTab"]];
  21. self.sideMenu = [[RNNSideMenuOptions alloc] initWithDict:dict[@"sideMenu"]];
  22. self.splitView = [[RNNSplitViewOptions alloc] initWithDict:dict[@"splitView"]];
  23. self.overlay = [[RNNOverlayOptions alloc] initWithDict:dict[@"overlay"]];
  24. self.animations = [[RNNAnimationsOptions alloc] initWithDict:dict[@"animations"]];
  25. self.statusBar = [[RNNStatusBarOptions alloc] initWithDict:dict[@"statusBar"]];
  26. self.preview = [[RNNPreviewOptions alloc] initWithDict:dict[@"preview"]];
  27. self.layout = [[RNNLayoutOptions alloc] initWithDict:dict[@"layout"]];
  28. self.modal = [[RNNModalOptions alloc] initWithDict:dict[@"modal"]];
  29. self.deprecations = [[DeprecationOptions alloc] initWithDict:dict[@"deprecations"]];
  30. self.window = [[WindowOptions alloc] initWithDict:dict[@"window"]];
  31. self.popGesture = [[Bool alloc] initWithValue:dict[@"popGesture"]];
  32. self.backgroundImage = [ImageParser parse:dict key:@"backgroundImage"];
  33. self.rootBackgroundImage = [ImageParser parse:dict key:@"rootBackgroundImage"];
  34. self.modalPresentationStyle = [[Text alloc] initWithValue:dict[@"modalPresentationStyle"]];
  35. self.modalTransitionStyle = [[Text alloc] initWithValue:dict[@"modalTransitionStyle"]];
  36. return self;
  37. }
  38. - (instancetype)initEmptyOptions {
  39. self = [self initWithDict:@{}];
  40. return self;
  41. }
  42. - (RNNNavigationOptions *)copy {
  43. RNNNavigationOptions* newOptions = [[RNNNavigationOptions alloc] initWithDict:@{}];
  44. [newOptions overrideOptions:self];
  45. return newOptions;
  46. }
  47. - (RNNNavigationOptions *)withDefault:(RNNNavigationOptions *)defaultOptions {
  48. return (RNNNavigationOptions *)[super withDefault:defaultOptions];
  49. }
  50. @end