From 8527b29e50cef817c81184e1053ca2b884acc1f1 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 8 Jun 2020 17:19:17 +0530 Subject: [PATCH 1/2] 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. --- .../SplitViewController/MVMCoreUISplitViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 1e04d987..b749ab4a 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -407,10 +407,10 @@ CGFloat const PanelAnimationDuration = 0.2; - (void)setRightNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { 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]; } - NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController]; if (extraButtons) { [navigationItems addObjectsFromArray:extraButtons]; } From 45df4e9b2ac09816b6eadc94cd79df65714f0752 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Tue, 9 Jun 2020 20:44:44 +0530 Subject: [PATCH 2/2] adding same check for left panel button --- .../SplitViewController/MVMCoreUISplitViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index b749ab4a..fe8036d2 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -240,7 +240,7 @@ CGFloat const PanelAnimationDuration = 0.2; if (extraButtons) { [leftBarButtonItems addObjectsFromArray:extraButtons]; } - if ((accessible && !extended) && self.leftPanelButton) { + if ((accessible && !extended) && self.leftPanelButton && ![extraButtons containsObject:self.leftPanelButton]) { [leftBarButtonItems addObject:self.leftPanelButton]; } [viewController.navigationItem setLeftBarButtonItems:(leftBarButtonItems.count > 0 ? leftBarButtonItems : nil) animated:!DisableAnimations];