diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift index 122adcee..5e998a53 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift @@ -14,4 +14,6 @@ public protocol PageModelProtocol { var backgroundColor: Color? { get set } var navigationBar: (NavigationItemModelProtocol & MoleculeModelProtocol)? { get set } var shouldMaskScreenWhileRecording: Bool? { get } + var hideLeftPanel: Bool? { get } + var hideRightPanel: Bool? { get } } diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index 6c831ac8..b5c4763c 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -32,8 +32,8 @@ import Foundation public var tabBarIndex: Int? public var shouldMaskScreenWhileRecording: Bool? - public var hideLeftPanel: Bool = false - public var hideRightPanel: Bool = false + public var hideLeftPanel: Bool? + public var hideRightPanel: Bool? public func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> Bool { return try replaceChildMolecule(at: &navigationBar, with: molecule) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 08a84d83..5997847d 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -559,7 +559,7 @@ import MVMCore public func isRightPanelAccessible() -> Bool { // TODO: Remove when FAB is 100%. - if loadObject?.pageJSON?.boolForKey(KeyHideRightPanel) ?? false { + if let hideRightPanel = model?.hideRightPanel, hideRightPanel == true { return false } return (MVMCoreUISession.sharedGlobal()?.launchAppLoadedSuccessfully ?? false) || showRightPanelForScreenBeforeLaunchApp() diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index 020c9e17..ab77986b 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -26,7 +26,6 @@ extern NSString * const KeyEnabled; extern NSString * const KeyFieldName; extern NSString * const KeyHideMainMenu; -extern NSString * const KeyHideRightPanel; extern NSString * const KeyProgressPercent; extern NSString * const KeyPrimaryButton; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index bee0a8b9..2483826f 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -27,7 +27,6 @@ NSString * const KeyFieldKey = @"fieldKey"; NSString * const KeyRequired = @"required"; NSString * const KeyHideMainMenu = @"hideMainMenu"; -NSString * const KeyHideRightPanel = @"hideRightPanel"; NSString * const KeyProgressPercent = @"progressPercent"; NSString * const KeyPrimaryButton = @"PrimaryButton";