From 25791918205b83b495351250dc25c932be0afb9c Mon Sep 17 00:00:00 2001 From: Barry Kostjens Date: Thu, 2 Mar 2017 15:38:24 +0100 Subject: [PATCH 1/2] sideMenuButton now is on the right, even when there are existing navigation items. --- Source/UIKitExtensions.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/UIKitExtensions.swift b/Source/UIKitExtensions.swift index 529c08a..b457c87 100644 --- a/Source/UIKitExtensions.swift +++ b/Source/UIKitExtensions.swift @@ -77,7 +77,12 @@ public extension UINavigationController { let spacer = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.fixedSpace, target: nil, action: nil) spacer.width = -10 - items.append(contentsOf: positionLeft ? [spacer, item] : [item, spacer]) + if positionLeft { + items.append(contentsOf: positionLeft ? [spacer, item] : [item, spacer]) + } else { + items.insert(contentsOf: [spacer, item], at: 0) + } + return items } } From 667e682b19b3c8282eba79d69deb150b575e39de Mon Sep 17 00:00:00 2001 From: Barry Kostjens Date: Thu, 2 Mar 2017 15:43:11 +0100 Subject: [PATCH 2/2] (small cleanup) sideMenuButton now is on the right, even when there are existing navigation items --- Source/UIKitExtensions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/UIKitExtensions.swift b/Source/UIKitExtensions.swift index b457c87..b566e34 100644 --- a/Source/UIKitExtensions.swift +++ b/Source/UIKitExtensions.swift @@ -78,7 +78,7 @@ public extension UINavigationController { spacer.width = -10 if positionLeft { - items.append(contentsOf: positionLeft ? [spacer, item] : [item, spacer]) + items.append(contentsOf: [spacer, item]) } else { items.insert(contentsOf: [spacer, item], at: 0) }