yogevbd 6 anos atrás
pai
commit
466010f76e
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2
    2
      lib/ios/RNNRootViewController.m

+ 2
- 2
lib/ios/RNNRootViewController.m Ver arquivo

@@ -172,12 +172,12 @@
172 172
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
173 173
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
174 174
 			self.navigationController.navigationBar.clipsToBounds = YES;
175
-		} else if ([[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
175
+		} else if (self.navigationController.navigationBar.subviews.count && [[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
176 176
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
177 177
 			self.navigationController.navigationBar.clipsToBounds = NO;
178 178
 		}
179 179
 	} if (_customTopBarBackground && _customTopBarBackground.superview == nil) {
180
-		if ([[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
180
+		if (self.navigationController.navigationBar.subviews.count && [[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
181 181
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
182 182
 		}
183 183
 		[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];