react-native-navigation的迁移库

RNNNavigationOptions.m 2.2KB

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