From 62196186a83a2d842425747a67cb6e9e388a99b5 Mon Sep 17 00:00:00 2001 From: Anatoliy Radchenko Date: Mon, 20 Feb 2017 15:08:21 +0300 Subject: [PATCH] additional check when embedding --- Source/SideMenuController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/SideMenuController.swift b/Source/SideMenuController.swift index a4f1aa9..69fdaae 100644 --- a/Source/SideMenuController.swift +++ b/Source/SideMenuController.swift @@ -89,6 +89,14 @@ public extension SideMenuController { */ public func embed(centerViewController controller: UIViewController, cacheIdentifier: String? = nil) { + guard controller !== centerViewController else { + if sidePanelVisible { + animate(toReveal: false) + } + + return + } + if let id = cacheIdentifier { controllersCache[id] = controller }