diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index 6484c7ec..2c8e3997 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -146,7 +146,7 @@ // Avoid the setter so we are only setting the bool and wait for view will appear to update the navigation bar. _masterShouldBeAccessible = [self isMasterInitiallyAccessible]; - _supportShouldBeAccessible = ![MVMCoreUISession sharedGlobal].disableSupport && [self isSupportInitiallyAccessible]; + _supportShouldBeAccessible = [self isSupportInitiallyAccessible]; // Observe for cache updates if desired. [self observeForResponseJSONUpdates]; diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h index af02281d..8c1a7715 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h @@ -120,6 +120,10 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { - (nullable UIViewController *)createLeftPanelViewController; - (nullable UIViewController *)createRightPanelViewController; +//replace gloabl panel +- (void)updateGlobalLeftPanelViewController:(nullable UIViewController *)leftPanelController; +- (void)updateGlobalRightPanelViewController:(nullable UIViewController *)rightPanelController; + // subclass to change image of back button - (nullable UIImage *)imageForBackButton; diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index b5177b9b..15dfba04 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -114,6 +114,14 @@ CGFloat const PanelAnimationDuration = 0.2; return nil; } +- (void)updateGlobalLeftPanelViewController:(nullable UIViewController *)leftPanelController { + self.globalLeftPanel = leftPanelController; +} + +- (void)updateGlobalRightPanelViewController:(nullable UIViewController *)rightPanelController { + self.globalRightPanel = rightPanelController; +} + - (nullable NSArray *)additionalLeftButtons { return nil; } @@ -316,6 +324,9 @@ CGFloat const PanelAnimationDuration = 0.2; } - (void)hideLeftPanelAnimated:(BOOL)animated checkingForOtherExtendedDrawers:(BOOL)checkingForOtherExtendedDrawers { + if (!self.globalLeftPanel) { + return; + } [MVMCoreDispatchUtility performBlockOnMainThread:^{ if (self.mainViewLeading.constant > .1) { if (checkingForOtherExtendedDrawers && self.explictlyShowingPanel == self.leftPanel) { @@ -355,6 +366,9 @@ CGFloat const PanelAnimationDuration = 0.2; } - (void)showLeftPanelAnimated:(BOOL)animated explict:(BOOL)explict { + if (!self.globalLeftPanel) { + return; + } [MVMCoreDispatchUtility performBlockOnMainThread:^{ if (self.mainViewLeading.constant < .1) { BOOL shouldExtendLeftPanel = [self shouldExtendLeftPanel]; @@ -509,6 +523,9 @@ CGFloat const PanelAnimationDuration = 0.2; } - (void)hideRightPanelAnimated:(BOOL)animated checkingForOtherExtendedDrawers:(BOOL)checkingForOtherExtendedDrawers { + if (!self.globalRightPanel) { + return; + } [MVMCoreDispatchUtility performBlockOnMainThread:^{ if (self.mainViewTrailing.constant > .1) { if (checkingForOtherExtendedDrawers && self.explictlyShowingPanel == self.rightPanel) { @@ -548,6 +565,9 @@ CGFloat const PanelAnimationDuration = 0.2; } - (void)showRightPanelAnimated:(BOOL)animated explict:(BOOL)explict { + if (!self.globalRightPanel) { + return; + } [MVMCoreDispatchUtility performBlockOnMainThread:^{ if (self.mainViewTrailing.constant < .1) { BOOL shouldExtendRightPanel = [self shouldExtendRightPanel]; diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h index ac7b2dbc..ca2db26e 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h @@ -31,9 +31,6 @@ NS_ASSUME_NONNULL_BEGIN //indicates if the app launched successfully @property (assign, nonatomic) BOOL launchAppLoadedSuccessfully; -//indicates if support is enabled -@property (assign, nonatomic) BOOL disableSupport; - // Allows a global overload of the title view of navigation item. - (nullable UIView *)titleViewForController:(nonnull MFViewController *)controller;