Ver código fonte

Detach button react view on reload (#3805)

Yogev Ben David 6 anos atrás
pai
commit
ea00ae09e0
Nenhuma conta vinculada ao e-mail do autor do commit
2 arquivos alterados com 4 adições e 6 exclusões
  1. 2
    6
      lib/ios/RNNNavigationButtons.m
  2. 2
    0
      lib/ios/RNNRootViewController.m

+ 2
- 6
lib/ios/RNNNavigationButtons.m Ver arquivo

@@ -7,8 +7,6 @@
7 7
 @interface RNNNavigationButtons()
8 8
 
9 9
 @property (weak, nonatomic) RNNRootViewController* viewController;
10
-@property (strong, nonatomic) NSArray* rightButtons;
11
-@property (strong, nonatomic) NSArray* leftButtons;
12 10
 @property (strong, nonatomic) RNNButtonOptions* defaultLeftButtonStyle;
13 11
 @property (strong, nonatomic) RNNButtonOptions* defaultRightButtonStyle;
14 12
 
@@ -47,13 +45,11 @@
47 45
 	}
48 46
 	
49 47
 	if ([side isEqualToString:@"left"]) {
50
-		self.leftButtons = barButtonItems;
51
-		[self.viewController.navigationItem setLeftBarButtonItems:self.leftButtons animated:animated];
48
+		[self.viewController.navigationItem setLeftBarButtonItems:barButtonItems animated:animated];
52 49
 	}
53 50
 	
54 51
 	if ([side isEqualToString:@"right"]) {
55
-		self.rightButtons = barButtonItems;
56
-		[self.viewController.navigationItem setRightBarButtonItems:self.rightButtons animated:animated];
52
+		[self.viewController.navigationItem setRightBarButtonItems:barButtonItems animated:animated];
57 53
 	}
58 54
 }
59 55
 

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

@@ -368,6 +368,8 @@
368 368
 	[[NSNotificationCenter defaultCenter] removeObserver:self.view];
369 369
 	self.view = nil;
370 370
 	self.navigationItem.titleView = nil;
371
+	self.navigationItem.rightBarButtonItems = nil;
372
+	self.navigationItem.leftBarButtonItems = nil;
371 373
 	_customTopBar = nil;
372 374
 	_customTitleView = nil;
373 375
 	_customTopBarBackground = nil;