Browse Source

Fixes topBar.title.component with default options

yogevbd 6 years ago
parent
commit
aa4326d5e0
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      lib/ios/RNNRootViewController.m

+ 9
- 9
lib/ios/RNNRootViewController.m View File

41
 	self.options = options;
41
 	self.options = options;
42
 	[self.presenter applyOptionsOnInit:self.options];
42
 	[self.presenter applyOptionsOnInit:self.options];
43
 	
43
 	
44
-	self.animator = [[RNNAnimator alloc] initWithTransitionOptions:self.options.customTransition];
44
+	self.animator = [[RNNAnimator alloc] initWithTransitionOptions:self.optionsWithDefault.customTransition];
45
 	
45
 	
46
 	[[NSNotificationCenter defaultCenter] addObserver:self
46
 	[[NSNotificationCenter defaultCenter] addObserver:self
47
 											 selector:@selector(onJsReload)
47
 											 selector:@selector(onJsReload)
156
 }
156
 }
157
 
157
 
158
 - (void)setTitleViewWithSubtitle {
158
 - (void)setTitleViewWithSubtitle {
159
-	if (self.options.topBar.subtitle.text.hasValue) {
159
+	if (self.optionsWithDefault.topBar.subtitle.text.hasValue) {
160
 		RNNTitleViewHelper* titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:self.optionsWithDefault.topBar.title subTitleOptions:self.optionsWithDefault.topBar.subtitle viewController:self];
160
 		RNNTitleViewHelper* titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:self.optionsWithDefault.topBar.title subTitleOptions:self.optionsWithDefault.topBar.subtitle viewController:self];
161
 		[titleViewHelper setup];
161
 		[titleViewHelper setup];
162
 	}
162
 	}
164
 
164
 
165
 - (void)setCustomNavigationTitleView {
165
 - (void)setCustomNavigationTitleView {
166
 	if (!_customTitleView && _isBeingPresented) {
166
 	if (!_customTitleView && _isBeingPresented) {
167
-		if (self.options.topBar.title.component.name.hasValue) {
168
-			_customTitleView = (RNNReactView*)[_creator createRootViewFromComponentOptions:self.options.topBar.title.component];
167
+		if (self.optionsWithDefault.topBar.title.component.name.hasValue) {
168
+			_customTitleView = (RNNReactView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.title.component];
169
 			_customTitleView.backgroundColor = UIColor.clearColor;
169
 			_customTitleView.backgroundColor = UIColor.clearColor;
170
-			NSString* alignment = [self.options.topBar.title.component.alignment getWithDefaultValue:@""];
170
+			NSString* alignment = [self.optionsWithDefault.topBar.title.component.alignment getWithDefaultValue:@""];
171
 			[_customTitleView setAlignment:alignment];
171
 			[_customTitleView setAlignment:alignment];
172
 			BOOL isCenter = [alignment isEqualToString:@"center"];
172
 			BOOL isCenter = [alignment isEqualToString:@"center"];
173
 			__weak RNNReactView *weakTitleView = _customTitleView;
173
 			__weak RNNReactView *weakTitleView = _customTitleView;
193
 
193
 
194
 - (void)setCustomNavigationBarView {
194
 - (void)setCustomNavigationBarView {
195
 	if (!_customTopBar) {
195
 	if (!_customTopBar) {
196
-		if (self.options.topBar.component.name.hasValue) {
197
-			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.options.topBar.component];
196
+		if (self.optionsWithDefault.topBar.component.name.hasValue) {
197
+			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.component];
198
 			
198
 			
199
 			_customTopBar = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
199
 			_customTopBar = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
200
 			reactView.backgroundColor = UIColor.clearColor;
200
 			reactView.backgroundColor = UIColor.clearColor;
213
 
213
 
214
 - (void)setCustomNavigationComponentBackground {
214
 - (void)setCustomNavigationComponentBackground {
215
 	if (!_customTopBarBackground) {
215
 	if (!_customTopBarBackground) {
216
-		if (self.options.topBar.background.component.name.hasValue) {
217
-			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.options.topBar.background.component];
216
+		if (self.optionsWithDefault.topBar.background.component.name.hasValue) {
217
+			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.background.component];
218
 			
218
 			
219
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
219
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
220
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
220
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];