Parcourir la source

Detach button react view on reload (#3805)

Yogev Ben David il y a 6 ans
Parent
révision
ea00ae09e0
No account linked to committer's email address
2 fichiers modifiés avec 4 ajouts et 6 suppressions
  1. 2
    6
      lib/ios/RNNNavigationButtons.m
  2. 2
    0
      lib/ios/RNNRootViewController.m

+ 2
- 6
lib/ios/RNNNavigationButtons.m Voir le fichier

7
 @interface RNNNavigationButtons()
7
 @interface RNNNavigationButtons()
8
 
8
 
9
 @property (weak, nonatomic) RNNRootViewController* viewController;
9
 @property (weak, nonatomic) RNNRootViewController* viewController;
10
-@property (strong, nonatomic) NSArray* rightButtons;
11
-@property (strong, nonatomic) NSArray* leftButtons;
12
 @property (strong, nonatomic) RNNButtonOptions* defaultLeftButtonStyle;
10
 @property (strong, nonatomic) RNNButtonOptions* defaultLeftButtonStyle;
13
 @property (strong, nonatomic) RNNButtonOptions* defaultRightButtonStyle;
11
 @property (strong, nonatomic) RNNButtonOptions* defaultRightButtonStyle;
14
 
12
 
47
 	}
45
 	}
48
 	
46
 	
49
 	if ([side isEqualToString:@"left"]) {
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
 	if ([side isEqualToString:@"right"]) {
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 Voir le fichier

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