Bug: rightPanelButton and fixed space is getting added multiple times, if additionalRightButtonsForViewController method is called multiple times.
Solution: putting a check, if rightPanelButton is already part of additionalRightButtonsForViewController, then no need to add it again.
This commit is contained in:
parent
ee888c21ac
commit
8527b29e50
@ -407,10 +407,10 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
- (void)setRightNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended {
|
- (void)setRightNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended {
|
||||||
NSMutableArray *navigationItems = [[NSMutableArray alloc] init];
|
NSMutableArray *navigationItems = [[NSMutableArray alloc] init];
|
||||||
if ((accessible && !extended) && self.rightPanelButton) {
|
NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController];
|
||||||
|
if ((accessible && !extended) && self.rightPanelButton && ![extraButtons containsObject:self.rightPanelButton]) {
|
||||||
[navigationItems addObject:self.rightPanelButton];
|
[navigationItems addObject:self.rightPanelButton];
|
||||||
}
|
}
|
||||||
NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController];
|
|
||||||
if (extraButtons) {
|
if (extraButtons) {
|
||||||
[navigationItems addObjectsFromArray:extraButtons];
|
[navigationItems addObjectsFromArray:extraButtons];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user