From 999429f6bb430ad164d5e2ae55617222116814ee Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 16 Jan 2019 11:01:39 -0500 Subject: [PATCH] title view fix. separator fix --- MVMCoreUI/BaseControllers/MFViewController.h | 12 ------- MVMCoreUI/BaseControllers/MFViewController.m | 35 ++++++------------- .../MVMCoreUISplitViewController.m | 1 + ...MVMCoreUITabBarPageControlViewController.m | 4 --- .../OtherHandlers/MVMCoreUILoggingHandler.h | 4 +-- MVMCoreUI/Session/MVMCoreUISession.h | 12 ++++--- MVMCoreUI/Session/MVMCoreUISession.m | 4 +++ .../TopAlert/MVMCoreUITopAlertBaseView.m | 1 + 8 files changed, 27 insertions(+), 46 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController.h b/MVMCoreUI/BaseControllers/MFViewController.h index 58deb624..2653f172 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.h +++ b/MVMCoreUI/BaseControllers/MFViewController.h @@ -116,9 +116,6 @@ // Called when the back button is pressed. Overwrite for special functionality. Default is to just popviewcontroller. - (void)backButtonPressed; -// Called when the close button is pressed. -- (void)closeButtonPressed; - // Handles the error. Logs and shows to screen. - (void)handleErrorAsPopup:(nonnull MVMCoreErrorObject *)error; @@ -265,15 +262,6 @@ // can be subclased to return dynamic pagename values for page tracking - (nullable NSArray *)dynamicPageNameValuesToTrackPage; -#pragma mark - review app pop up - -//client side logic to prevent review app, it should only be configured for extra client logic to show or not show review app pop up -- (BOOL)shouldReviewApp; - -#pragma mark - extra logic for support - -- (nullable NSDictionary *)extraStartInfoForSupport; - #pragma mark - Animation // main manager used for intro animations diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index e6873d94..8ad408cc 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -33,6 +33,7 @@ #import "MVMCoreUIConstants.h" #import "MVMCoreUISession.h" #import "MVMCoreUILoggingHandler.h" +@import MVMCore.MVMCoreConstants; @import MVMAnimationFramework; @@ -95,7 +96,6 @@ } - (void)setScreenHeadingMessage:(nullable NSString *)screenHeadingMessage { - if (screenHeadingMessage.length > 0) { if (self.titleLabel) { self.titleLabel.text = screenHeadingMessage; @@ -111,11 +111,15 @@ } - (void)newDataBuildScreen { - // Sets the screen to use the screen heading. - NSString *screenHeading = [self screenHeading]; - - if (screenHeading) { - [self setScreenHeadingMessage:screenHeading]; + UIView *titleView = [[MVMCoreUISession sharedGlobal] titleViewForController:self]; + if (titleView) { + self.navigationItem.titleView = titleView; + } else { + // Sets the screen to use the screen heading. + NSString *screenHeading = [self screenHeading]; + if (screenHeading) { + [self setScreenHeadingMessage:screenHeading]; + } } } @@ -145,10 +149,6 @@ [[MVMCoreNavigationHandler sharedNavigationHandler] popViewController:(self.tabBarPageControl ?: self) animated:YES]; } -- (void)closeButtonPressed { - // TODO: Handle close button action with action map -} - - (void)handleErrorAsPopup:(nonnull MVMCoreErrorObject *)error { // Logs the error. @@ -290,7 +290,7 @@ // Update separator. UIView *separatorView = (UIView *)[MVMCoreUISession sharedGlobal].splitViewController.navigationBarSeparator; - separatorView.hidden = ([self.class isKindOfClass:[MVMCoreUITabBarPageControlViewController class]] + separatorView.hidden = ([self isKindOfClass:[MVMCoreUITabBarPageControlViewController class]] || self.tabBarPageControl || self.loadObject.requestParameters.tabWasPressed); } @@ -749,13 +749,6 @@ return nil; } -#pragma mark - review app pop up - -//client side logic to prevent review app, it should only be configured for extra client logic to show or not show review app pop up -- (BOOL)shouldReviewApp { - return YES; -} - //Accessibility - (void) focusElement:(id) element { dispatch_async(dispatch_get_main_queue(), ^{ @@ -763,12 +756,6 @@ }); } -// support - -- (NSDictionary *)extraStartInfoForSupport { - return nil; -} - #pragma mark - Animations // subclass to override default intro animations -(void) setupIntroAnimations { diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index d47f8ee3..745330f3 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -23,6 +23,7 @@ #import "MVMCoreUISession.h" #import "MVMCoreUIConstants.h" #import "MVMCoreUICommonViewsUtility.h" +#import "MVMCoreUITopAlertView.h" @interface MVMCoreUISplitViewController () diff --git a/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m b/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m index 39320dad..5b038e89 100644 --- a/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m +++ b/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m @@ -222,10 +222,6 @@ [self.viewController backButtonPressed]; } -- (void)closeButtonPressed { - [self.viewController closeButtonPressed]; -} - - (BOOL)navigationBarHidden { return [self.viewController navigationBarHidden]; } diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h index 26678257..61a99c48 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h @@ -6,8 +6,8 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -#import - +@import MVMCore.MVMCoreLoggingHandler; +@class MVMCoreTopAlertObject; @class MFViewController; NS_ASSUME_NONNULL_BEGIN diff --git a/MVMCoreUI/Session/MVMCoreUISession.h b/MVMCoreUI/Session/MVMCoreUISession.h index b5ac2d6c..b3867ddd 100644 --- a/MVMCoreUI/Session/MVMCoreUISession.h +++ b/MVMCoreUI/Session/MVMCoreUISession.h @@ -6,10 +6,11 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -#import -#import -#import - +@import UIKit.UIView; +@import MVMCore.MVMCoreSessionObject; +@class MVMCoreUITopAlertView; +@class MVMCoreUISplitViewController; +@class MFViewController; NS_ASSUME_NONNULL_BEGIN @interface MVMCoreUISession : MVMCoreSessionObject @@ -23,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN //indicates if the app launched successfully @property (assign, nonatomic) BOOL launchAppLoadedSuccessfully; +// Allows a global overload of the title view of navigation item. +- (nullable UIView *)titleViewForController:(nonnull MFViewController *)controller; + @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/Session/MVMCoreUISession.m b/MVMCoreUI/Session/MVMCoreUISession.m index 60667a57..afe99b76 100644 --- a/MVMCoreUI/Session/MVMCoreUISession.m +++ b/MVMCoreUI/Session/MVMCoreUISession.m @@ -10,4 +10,8 @@ @implementation MVMCoreUISession +- (nullable UIView *)titleViewForController:(nonnull MFViewController *)controller { + return nil; +} + @end diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m index 08b92f1a..6d3a2786 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m @@ -19,6 +19,7 @@ #import "MVMCoreUICommonViewsUtility.h" #import "MFStyler.h" #import "MVMCoreUISession.h" +@import MVMCore.MVMCoreTopAlertDelegateProtocol; @implementation MVMCoreUITopAlertBaseView