From 8527b29e50cef817c81184e1053ca2b884acc1f1 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 8 Jun 2020 17:19:17 +0530 Subject: [PATCH 1/3] 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 cb53c28e372eefac253f6fcff12d19f3e64d9ce7 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 9 Jun 2020 10:43:18 -0400 Subject: [PATCH 2/3] match android --- .../Atomic/Templates/MoleculeStackTemplate.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift index 41619142..2bb5ec31 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift @@ -50,15 +50,15 @@ open class MoleculeStackTemplate: ThreeLayerViewController, TemplateProtocol { } open override func viewForMiddle() -> UIView? { + guard let moleculeStackModel = templateModel?.moleculeStack else { return nil } - guard let moleculeStackModel = templateModel?.moleculeStack else { - return nil - } - + // By default: Stack template stack has vertical space before the first item, dynamic stack items have default horizontal padding. let stack = MoleculeStackView(frame: .zero) moleculeStackModel.useStackSpacingBeforeFirstItem = true - if moleculeStackModel.useHorizontalMargins == nil { - moleculeStackModel.useHorizontalMargins = true + for stackItem in moleculeStackModel.molecules { + guard let stackItem = stackItem as? MoleculeStackItemModel, + stackItem.horizontalAlignment == nil else { continue } + stackItem.useHorizontalMargins = true } stack.set(with: moleculeStackModel, delegateObject() as? MVMCoreUIDelegateObject, nil) return stack From 45df4e9b2ac09816b6eadc94cd79df65714f0752 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Tue, 9 Jun 2020 20:44:44 +0530 Subject: [PATCH 3/3] 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];