From d0f073636038f49c2f8098f7fa052eb8ceb3fe55 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 25 Jan 2019 12:56:29 -0500 Subject: [PATCH 1/8] attempt to standardize json for top labels --- MVMCoreUI/Atoms/Views/MFLabel.h | 3 ++ MVMCoreUI/Atoms/Views/MFLabel.m | 5 ++++ ...abelsAndBottomButtonsTableViewController.m | 23 +++------------ .../TopLabelsAndBottomButtonsViewController.m | 6 +--- MVMCoreUI/Molecules/TopLabelsView.h | 3 ++ MVMCoreUI/Molecules/TopLabelsView.m | 29 +++++++++++++++++-- .../MVMCoreUILargeHeaderSingleLabelTemplate.h | 14 ++++++++- .../MVMCoreUILargeHeaderSingleLabelTemplate.m | 20 +------------ 8 files changed, 57 insertions(+), 46 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/MFLabel.h b/MVMCoreUI/Atoms/Views/MFLabel.h index 1284137b..a7386425 100644 --- a/MVMCoreUI/Atoms/Views/MFLabel.h +++ b/MVMCoreUI/Atoms/Views/MFLabel.h @@ -74,4 +74,7 @@ - (void)styleB1:(BOOL)scale; - (void)styleTableRow:(BOOL)scale; +// Without color +- (void)setFontH1:(BOOL)scale; + @end diff --git a/MVMCoreUI/Atoms/Views/MFLabel.m b/MVMCoreUI/Atoms/Views/MFLabel.m index 9167884e..39aeb851 100644 --- a/MVMCoreUI/Atoms/Views/MFLabel.m +++ b/MVMCoreUI/Atoms/Views/MFLabel.m @@ -308,6 +308,11 @@ [self setScale:scale]; } +- (void)setFontH1:(BOOL)scale { + self.font = [MFStyler fontH1:NO]; + [self setScale:scale]; +} + - (void)setAccessibilityTraits:(UIAccessibilityTraits)accessibilityTraits { if (accessibilityTraits& UIAccessibilityTraitHeader) { diff --git a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m index 2711aae9..ed6d242d 100644 --- a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m +++ b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m @@ -37,19 +37,6 @@ @implementation TopLabelsAndBottomButtonsTableViewController -- (void)backButtonPressed { - [super backButtonPressed]; - - //[self tryToCleanUpMemory]; -} - -- (void)tryToCleanUpMemory { - //[self.footerView removeFromSuperview]; - //self.footerView = nil; - //self.footerAccessoryView = nil; - //self.bottomView = nil; -} - - (void)initialLoad { [super initialLoad]; self.rebuildUIOnSizeChange = YES; @@ -156,9 +143,11 @@ [self.tableView reloadData]; } --(void)setHeadlineAndMessage { - [self.topLabelsView setHeadlineString:[[self mapForTopLabels] stringForKey:KeyTitle] messageString:[[self mapForTopLabels] stringForKey:KeyMessage]]; + +- (void)setHeadlineAndMessage { + [self.topLabelsView setWtihJSON:[self mapForTopLabels]]; } + - (void)updateViewConstraints { [super updateViewConstraints]; @@ -217,10 +206,6 @@ } } -- (void)viewDidLoad { - [super viewDidLoad]; -} - - (void)setUpHeaderAccessoryView { UIView *headerAccessoryView = [[UIView alloc] initWithFrame:CGRectZero]; headerAccessoryView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m index e29c26dc..66216dd2 100644 --- a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m +++ b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m @@ -113,6 +113,7 @@ self.topLabelsView = topLabelsView; topView = topLabelsView; self.topView = topView; + [topLabelsView setWtihJSON:[self mapForTopLabels]]; } [self.contentView addSubview:topView]; [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView)]]; @@ -263,11 +264,6 @@ [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topBetweenEdgeView]-0-[spacer]-0-[bottomBetweenEdgeView]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topBetweenEdgeView,spacer,bottomBetweenEdgeView)]]; } - - if (self.topLabelsView) { - [self.topLabelsView setHeadlineString:[[self mapForTopLabels] stringForKey:KeyTitle] messageString:[[self mapForTopLabels] stringForKey:KeyMessage]]; - } - } - (void)updateViewConstraints { diff --git a/MVMCoreUI/Molecules/TopLabelsView.h b/MVMCoreUI/Molecules/TopLabelsView.h index e4e6494a..3e2f8d2d 100644 --- a/MVMCoreUI/Molecules/TopLabelsView.h +++ b/MVMCoreUI/Molecules/TopLabelsView.h @@ -50,4 +50,7 @@ - (void)setLeftConstant:(CGFloat)leftConstant; - (void)setRightConstant:(CGFloat)rightConstant; +// Sets up the ui based on the json +- (void)setWtihJSON:(nullable NSDictionary *)json; + @end diff --git a/MVMCoreUI/Molecules/TopLabelsView.m b/MVMCoreUI/Molecules/TopLabelsView.m index 54275f75..ccd45caf 100644 --- a/MVMCoreUI/Molecules/TopLabelsView.m +++ b/MVMCoreUI/Molecules/TopLabelsView.m @@ -14,6 +14,7 @@ #import #import #import +#import @interface TopLabelsView () @@ -30,8 +31,6 @@ @implementation TopLabelsView - - - (nullable instancetype)initWithTableView:(nullable TopLabelsAndBottomButtonsTableViewController *)tableView { if (self = [super init]) { self.tableView = tableView; @@ -216,5 +215,31 @@ self.rightConstraintSeparator.constant = rightConstant; } +- (void)setWtihJSON:(nullable NSDictionary *)json { + [self setHeadlineString:[json stringForKey:KeyTitle] messageString:[json stringForKey:KeyMessage]]; + UIColor *textColor = [self colorForTopLabelsWithJSON:json]; + self.headlineLabel.textColor = textColor; + self.messageLabel.textColor = textColor; + self.backgroundColor = [self colorForBackgroundWithJSON:json]; + self.separatorView.hidden = ![json boolForKey:@"showBottomLine"]; +} + +- (nonnull UIColor *)colorForTopLabelsWithJSON:(nullable NSDictionary *)json { + NSString *titleColor = [json string:@"titleBgColor"]; + if (titleColor) { + return [UIColor mfGetColorForHex:titleColor]; + } else { + return [UIColor blackColor]; + } +} + +- (nonnull UIColor *)colorForBackgroundWithJSON:(nullable NSDictionary *)json { + NSString *color = [json string:@"backgroundColor"]; + if (color) { + return [UIColor mfGetColorForHex:color]; + } else { + return [UIColor clearColor]; + } +} @end diff --git a/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.h b/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.h index 75a7474e..a73dd8cc 100644 --- a/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.h +++ b/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.h @@ -8,10 +8,22 @@ #import #import - +@class LabelView; +@class LabelWithInternalButton; NS_ASSUME_NONNULL_BEGIN @interface MVMCoreUILargeHeaderSingleLabelTemplate : TopLabelsAndBottomButtonsViewController + +// A label that can go below the top labels. Can be a normal label or one with internal buttons. +@property (nullable, weak, nonatomic) LabelView *labelViewUnderTopLabels; +@property (nullable, weak, nonatomic) LabelWithInternalButton *labelUnderTopLabelsWithInternalButton; + +// Override to specifiy the label under top label. Default uses the value for key "description" in the page json. +- (nullable NSString *)stringForLabelUnderTopLabels; + +// Override to specifiy the label under top label with internal button. Default uses the value for key "Link" in the "ButtonMap" of the page json. +- (nullable NSDictionary *)actionMapForLabelUnderTopLabelsWithInternalButton; + @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.m b/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.m index b11a8871..6f00dc6e 100644 --- a/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.m +++ b/MVMCoreUI/Templates/MVMCoreUILargeHeaderSingleLabelTemplate.m @@ -13,19 +13,13 @@ @interface MVMCoreUILargeHeaderSingleLabelTemplate () -// A label that can go below the top labels. Can be a normal label or one with internal buttons. -@property (nullable, weak, nonatomic) LabelView *labelViewUnderTopLabels; -@property (nullable, weak, nonatomic) LabelWithInternalButton *labelUnderTopLabelsWithInternalButton; - @end @implementation MVMCoreUILargeHeaderSingleLabelTemplate - (void)newDataBuildScreen { [super newDataBuildScreen]; - [self.topLabelsView.headlineLabel styleH1:YES]; - self.topLabelsView.separatorView.hidden = YES; - [self updateTopLabelsColor]; + [self.topLabelsView.headlineLabel setFontH1:YES]; } - (void)initialLoad { @@ -81,18 +75,6 @@ // Dispose of any resources that can be recreated. } -#pragma mark - Top labels style - -- (void)updateTopLabelsColor { - self.topLabelsView.headlineLabel.textColor = [UIColor blackColor]; - self.topLabelsView.messageLabel.textColor = [UIColor blackColor]; - NSString *titleColor = [[self mapForTopLabels] string:@"titleBgColor"]; - if (titleColor) { - self.topLabelsView.headlineLabel.textColor = [UIColor mfGetColorForHex:titleColor]; - self.topLabelsView.messageLabel.textColor = [UIColor mfGetColorForHex:titleColor]; - } -} - - (UIEdgeInsets)paddingForTopLabels { UIEdgeInsets edge = [super paddingForTopLabels]; edge.bottom = PaddingTwo; From 21707d5cd372a65b3d35d0ee7f128fdc173bdad7 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 25 Jan 2019 16:12:27 -0500 Subject: [PATCH 2/8] fix to class check for nil convenience functions init functions --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++ MVMCoreUI/BaseControllers/MFViewController.m | 4 +- ...CoreUINavigationControllerViewController.h | 25 ++++++++++ ...CoreUINavigationControllerViewController.m | 46 +++++++++++++++++++ .../MVMCoreUISplitViewController.h | 8 ++-- .../MVMCoreUISplitViewController.m | 24 +++++----- MVMCoreUI/MVMCoreUI.h | 2 + MVMCoreUI/Session/MVMCoreUISession.h | 6 ++- 8 files changed, 103 insertions(+), 20 deletions(-) create mode 100644 MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h create mode 100644 MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 8260a8c5..e7706a6d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m */; }; D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */; }; D29770C921F7C4AE00B2F0D0 /* TopLabelsView.h in Headers */ = {isa = PBXBuildFile; fileRef = D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */; settings = {ATTRIBUTES = (Public, ); }; }; D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D29770EE21F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m */; }; @@ -142,6 +144,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationControllerViewController.h; sourceTree = ""; }; + D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUINavigationControllerViewController.m; sourceTree = ""; }; D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopLabelsView.m; sourceTree = ""; }; D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopLabelsView.h; sourceTree = ""; }; D29770EE21F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopLabelsAndBottomButtonsTableViewController.m; sourceTree = ""; }; @@ -409,6 +413,8 @@ children = ( D29DF2B721E7BE79003B2FB9 /* TabBarController */, D29DF2B621E7BE66003B2FB9 /* SplitViewController */, + D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h */, + D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m */, ); path = Containers; sourceTree = ""; @@ -644,6 +650,7 @@ D29DF26421E6A9D9003B2FB9 /* MFTransparentGIFView.h in Headers */, D29DF27921E7A533003B2FB9 /* MVMCoreUISession.h in Headers */, D29DF25C21E6A2B6003B2FB9 /* DashLine.h in Headers */, + D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h in Headers */, D29DF29D21E7AE38003B2FB9 /* MFStyler.h in Headers */, D29DF2B021E7B3A4003B2FB9 /* MFTextView.h in Headers */, D29DF2A921E7B2F9003B2FB9 /* MVMCoreUIConstants.h in Headers */, @@ -816,6 +823,7 @@ D29DF2BF21E7BEA4003B2FB9 /* MVMCoreUITabBarPageControlViewController.m in Sources */, D29DF28321E7AB24003B2FB9 /* MVMCoreUICommonViewsUtility.m in Sources */, D29DF28A21E7AC2B003B2FB9 /* MFLabel.m in Sources */, + D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m in Sources */, D29DF27A21E7A533003B2FB9 /* MVMCoreUISession.m in Sources */, D29DF2C921E7BFC6003B2FB9 /* MFSizeObject.m in Sources */, D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */, diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index 9ae4d2a0..383d923a 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -35,7 +35,7 @@ #import "MVMCoreUISession.h" #import "MVMCoreUILoggingHandler.h" #import "MVMCoreUITabBarPageControlViewController.h" - +#import "MVMCoreUINavigationControllerViewController.h" @import MVMAnimationFramework; @interface MFViewController () @@ -290,7 +290,7 @@ [[MVMCoreUISession sharedGlobal].splitViewController setNavigationIconColor:navigationBarTintColor]; // Update separator. - UIView *separatorView = (UIView *)[MVMCoreUISession sharedGlobal].splitViewController.navigationBarSeparator; + UIView *separatorView = (UIView *)[MVMCoreUISession sharedGlobal].navigationController.separatorView; separatorView.hidden = ([self isKindOfClass:[MVMCoreUITabBarPageControlViewController class]] || self.manager || self.loadObject.requestParameters.tabWasPressed); diff --git a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h new file mode 100644 index 00000000..3ec6d4c7 --- /dev/null +++ b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h @@ -0,0 +1,25 @@ +// +// MVMCoreUINavigationControllerViewController.h +// MVMCoreUI +// +// Created by Scott Pfeil on 1/25/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +#import +@class SeparatorView; +NS_ASSUME_NONNULL_BEGIN + +@interface MVMCoreUINavigationControllerViewController : UINavigationController + +// Convenience getter ++ (nullable instancetype)navigationController; + +// Returns a navigation controller with the mvm styling. Also sets the navigation controller in the appropriate handlers. ++ (nullable instancetype)setupNavigationController; + +// Separator at the bottom of the navigation bar used for styling. +@property (nullable, weak, nonatomic) SeparatorView *separatorView; +@end + +NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m new file mode 100644 index 00000000..fc3f4310 --- /dev/null +++ b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m @@ -0,0 +1,46 @@ +// +// MVMCoreUINavigationControllerViewController.m +// MVMCoreUI +// +// Created by Scott Pfeil on 1/25/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +#import "MVMCoreUINavigationControllerViewController.h" +#import "UIColor+MFConvenience.h" +#import "SeparatorView.h" +#import "MFFonts.h" +#import "MFSizeObject.h" +#import "MVMCoreUISession.h" +@import MVMCore.MVMCoreActionUtility; +@import MVMCore.MVMCoreNavigationHandler; +@interface MVMCoreUINavigationControllerViewController () + +@end + +@implementation MVMCoreUINavigationControllerViewController + ++ (nullable instancetype)navigationController { + return [MVMCoreActionUtility initializerClassCheck:[MVMCoreUISession sharedGlobal].navigationController classToVerify:self]; +} + ++ (nullable instancetype)setupNavigationController { + MVMCoreUINavigationControllerViewController *navigationController = [[MVMCoreUINavigationControllerViewController alloc] init]; + [UIColor mfSetBackgroundColorForNavigationBar:[UIColor whiteColor] navigationBar:navigationController.navigationBar transparent:NO]; + [navigationController.navigationBar setShadowImage:[[UIImage alloc] init]]; + navigationController.navigationBar.translucent = NO; + navigationController.navigationBar.opaque = YES; + navigationController.navigationBar.tintColor = [UIColor blackColor]; + navigationController.separatorView = [SeparatorView separatorAddToView:navigationController.navigationBar position:SeparatorPositionBot withHorizontalPadding:0]; + [navigationController.separatorView setAsLight]; + [navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[MFFonts mfFont75Bd:[[MFSizeObject sizeObjectWithStandardSize:14 standardiPadPortraitSize:16 iPadProLandscapeSize:18] getValueBasedOnScreenSize]]}]; + + // Set standard + [MVMCoreUISession sharedGlobal].navigationController = navigationController; + [MVMCoreNavigationHandler sharedNavigationHandler].navigationController = navigationController; + [MVMCoreNavigationHandler sharedNavigationHandler].viewControllerToPresentOn = navigationController; + + return navigationController; +} + +@end diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h index 2fb3c0e6..6e59dde6 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h @@ -13,7 +13,7 @@ #import #import -@class SeparatorView; +@class MVMCoreUINavigationControllerViewController; @class MVMCoreUITopAlertView; @class MFViewController; @@ -35,11 +35,10 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { @property (nullable, strong, nonatomic) UIBarButtonItem *backButton; -@property (nullable, weak, nonatomic, readonly) UINavigationController *navigationController; +@property (nullable, weak, nonatomic, readonly) MVMCoreUINavigationControllerViewController *navigationController; // Reference to the top alert view @property (nullable, weak, nonatomic) MVMCoreUITopAlertView *topAlertView; -@property (nullable, strong, nonatomic) SeparatorView *navigationBarSeparator; // References to the current navigation item settings. @property (nonatomic, readonly) BOOL leftPanelIsAccessible; @@ -49,6 +48,9 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { // Convenience getter + (nullable instancetype)mainSplitViewController; +// Returns a split controller with the mvm styling. Also sets the appropriate handlers. ++ (nullable instancetype)setup; + #pragma mark - Panel Functions // Sets if the left panel accessible for the view controller. Will show or hide the button. diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index eadd6d57..861e13ac 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -12,6 +12,7 @@ @import MVMCore.MVMCoreViewControllerProtocol; @import MVMCore.MVMCoreViewManagerProtocol; @import MVMCore.MVMCoreObject; +@import MVMCore.MVMCoreActionUtility; #import "MVMCoreUIUtility.h" #import "UIColor+MFConvenience.h" #import "NSLayoutConstraint+MFConvenience.h" @@ -24,6 +25,7 @@ #import "MVMCoreUIConstants.h" #import "MVMCoreUICommonViewsUtility.h" #import "MVMCoreUITopAlertView.h" +#import "MVMCoreUINavigationControllerViewController.h" @interface MVMCoreUISplitViewController () @@ -40,7 +42,7 @@ @property (weak, nonatomic, readwrite) UIViewController *leftPanel; @property (weak, nonatomic, readwrite) UIViewController *rightPanel; -@property (weak, nonatomic, readwrite) UINavigationController *navigationController; +@property (weak, nonatomic, readwrite) MVMCoreUINavigationControllerViewController *navigationController; // A view that covers the detail view when the master is out. @property (weak, nonatomic) IBOutlet UIView *mainViewCoverView; @@ -77,7 +79,13 @@ typedef NS_OPTIONS(NSInteger, MFExtendedDrawer) { CGFloat const PanelAnimationDuration = 0.2; + (instancetype)mainSplitViewController { - return [MVMCoreUISession sharedGlobal].splitViewController; + return [MVMCoreActionUtility initializerClassCheck:[MVMCoreUISession sharedGlobal].splitViewController classToVerify:self]; +} + ++ (nullable instancetype)setup { + MVMCoreUISplitViewController *splitViewController = [[self alloc] init]; + [MVMCoreUISession sharedGlobal].splitViewController = splitViewController; + return splitViewController; } #pragma mark - Main Subclassables @@ -669,20 +677,10 @@ CGFloat const PanelAnimationDuration = 0.2; } // The main view. - UINavigationController *navigationController = [[UINavigationController alloc] init]; + MVMCoreUINavigationControllerViewController *navigationController = [MVMCoreUINavigationControllerViewController setupNavigationController]; self.navigationController = navigationController; self.automaticallyAdjustsScrollViewInsets = NO; - // Sets the navigation bar style - [UIColor mfSetBackgroundColorForNavigationBar:[UIColor whiteColor] navigationBar:navigationController.navigationBar transparent:NO]; - [navigationController.navigationBar setShadowImage:[[UIImage alloc] init]]; - navigationController.navigationBar.translucent = NO; - navigationController.navigationBar.opaque = YES; - navigationController.navigationBar.tintColor = [UIColor blackColor]; - self.navigationBarSeparator = [SeparatorView separatorAddToView:navigationController.navigationBar position:SeparatorPositionBot withHorizontalPadding:0]; - [self.navigationBarSeparator setAsLight]; - [navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[MFFonts mfFont75Bd:[[MFSizeObject sizeObjectWithStandardSize:14 standardiPadPortraitSize:16 iPadProLandscapeSize:18] getValueBasedOnScreenSize]]}]; - UIView *mainView = navigationController.view; mainView.translatesAutoresizingMaskIntoConstraints = NO; [self addChildViewController:navigationController]; diff --git a/MVMCoreUI/MVMCoreUI.h b/MVMCoreUI/MVMCoreUI.h index 4779ba75..6e2f0ea3 100644 --- a/MVMCoreUI/MVMCoreUI.h +++ b/MVMCoreUI/MVMCoreUI.h @@ -54,6 +54,8 @@ FOUNDATION_EXPORT const unsigned char MVMCoreUIVersionString[]; #import #pragma mark - Containers +#import + #import #import #import diff --git a/MVMCoreUI/Session/MVMCoreUISession.h b/MVMCoreUI/Session/MVMCoreUISession.h index b3867ddd..4589e12e 100644 --- a/MVMCoreUI/Session/MVMCoreUISession.h +++ b/MVMCoreUI/Session/MVMCoreUISession.h @@ -11,12 +11,14 @@ @class MVMCoreUITopAlertView; @class MVMCoreUISplitViewController; @class MFViewController; +@class MVMCoreUINavigationControllerViewController; NS_ASSUME_NONNULL_BEGIN @interface MVMCoreUISession : MVMCoreSessionObject -@property (strong, nonatomic, nullable) MVMCoreUITopAlertView *topAlertView; -@property (strong, nonatomic, nullable) MVMCoreUISplitViewController *splitViewController; +@property (weak, nonatomic, nullable) MVMCoreUITopAlertView *topAlertView; +@property (weak, nonatomic, nullable) MVMCoreUISplitViewController *splitViewController; +@property (weak, nonatomic, nullable) MVMCoreUINavigationControllerViewController *navigationController; // for handscroll Animation on subclasses of MFScrollingViewController @property (assign, nonatomic) BOOL enableHandScrollAnimation; From fd1a715f97e5ce8143a3c1e40b238d5018aa6658 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 25 Jan 2019 16:16:22 -0500 Subject: [PATCH 3/8] remove old code --- .../TopLabelsAndBottomButtonsTableViewController.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.h b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.h index e518e0da..04defbb4 100644 --- a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.h +++ b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.h @@ -33,8 +33,6 @@ - (void)showFooter; - (void)hideFooter; -- (void)tryToCleanUpMemory; - // showing/hiding left and right primary buttons - (void)setPrimaryLeftButtonHidden:(BOOL)left rightButtonHidden:(BOOL)right; From 9badc9432f2909b17a85b81ef38ae3438231bd03 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 25 Jan 2019 17:38:06 -0500 Subject: [PATCH 4/8] default presentation view controller. Re-use function --- .../SplitViewController/MVMCoreUISplitViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 861e13ac..50b50a84 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -888,7 +888,7 @@ CGFloat const PanelAnimationDuration = 0.2; } - (UIViewController *)getCurrentVisibleController { - UIViewController *baseViewController = [MVMCoreNavigationHandler sharedNavigationHandler].viewControllerToPresentOn; + UIViewController *baseViewController = [MVMCoreNavigationHandler sharedNavigationHandler].viewControllerToPresentOn ?: [UIApplication sharedApplication].keyWindow.rootViewController; UIViewController *viewController = nil; while (baseViewController.presentedViewController && !baseViewController.presentedViewController.isBeingDismissed) { viewController = baseViewController.presentedViewController; From 1d7e1be051324202ecae01fe2234c0837893fed6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 28 Jan 2019 14:25:29 -0500 Subject: [PATCH 5/8] Convenience for load screen re-link framework --- ...CoreUINavigationControllerViewController.h | 3 ++ ...CoreUINavigationControllerViewController.m | 6 +++ .../MVMCoreUISplitViewController.h | 6 ++- .../MVMCoreUISplitViewController.m | 45 +++-------------- MVMCoreUI/Session/MVMCoreUISession.h | 3 ++ MVMCoreUI/Session/MVMCoreUISession.m | 49 +++++++++++++++++++ 6 files changed, 71 insertions(+), 41 deletions(-) diff --git a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h index 3ec6d4c7..2fe06d1e 100644 --- a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h +++ b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.h @@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN // Returns a navigation controller with the mvm styling. Also sets the navigation controller in the appropriate handlers. + (nullable instancetype)setupNavigationController; +// Returns a navigation controller with the mvm styling. Also sets the navigation controller in the appropriate handlers. Adds the default loading overlay screen as well. ++ (nullable instancetype)setupWithNavigationControllerAsMainController; + // Separator at the bottom of the navigation bar used for styling. @property (nullable, weak, nonatomic) SeparatorView *separatorView; @end diff --git a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m index fc3f4310..f0143315 100644 --- a/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m +++ b/MVMCoreUI/Containers/MVMCoreUINavigationControllerViewController.m @@ -43,4 +43,10 @@ return navigationController; } ++ (nullable instancetype)setupWithNavigationControllerAsMainController { + MVMCoreUINavigationControllerViewController *navigationController = [self setupNavigationController]; + [[MVMCoreUISession sharedGlobal] setupAsStandardLoadViewDelegate:navigationController]; + return navigationController; +} + @end diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h index 6e59dde6..a5e5b6a9 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h @@ -9,7 +9,6 @@ #import @import MVMCore.MVMCoreActionDelegateProtocol; -@import MVMCore.MVMCoreLoadingOverlayDelegateProtocol; #import #import @@ -23,7 +22,7 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { MFTwoDrawer }; -@interface MVMCoreUISplitViewController : UIViewController +@interface MVMCoreUISplitViewController : UIViewController // Reference to the panels. @property (nullable, weak, nonatomic, readonly) UIViewController *leftPanel; @@ -51,6 +50,9 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { // Returns a split controller with the mvm styling. Also sets the appropriate handlers. + (nullable instancetype)setup; +// Returns a split controller with the mvm styling. Also sets the appropriate handlers. Also sets up the default load screen ++ (nullable instancetype)setupAsMainController; + #pragma mark - Panel Functions // Sets if the left panel accessible for the view controller. Will show or hide the button. diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 50b50a84..bd150f59 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -9,7 +9,6 @@ #import "MVMCoreUISplitViewController.h" @import MVMCore.MVMCoreNavigationHandler; @import MVMCore.MVMCoreDispatchUtility; -@import MVMCore.MVMCoreViewControllerProtocol; @import MVMCore.MVMCoreViewManagerProtocol; @import MVMCore.MVMCoreObject; @import MVMCore.MVMCoreActionUtility; @@ -18,7 +17,6 @@ #import "NSLayoutConstraint+MFConvenience.h" #import "MFViewController.h" #import "MFFonts.h" -#import "MFLoadingViewController.h" #import #import "SeparatorView.h" #import "MVMCoreUISession.h" @@ -50,8 +48,6 @@ @property (weak, nonatomic) IBOutlet UIProgressView *bottomProgressBar; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomProgressBarHeightConstraint; -@property (weak, nonatomic) MFLoadingViewController *loadingViewController; - @property (nonatomic, strong) UIGestureRecognizer *tapToDismissGesture; @property (nullable, readwrite, weak, nonatomic) NSObject *explictlyShowingPanel; @@ -88,6 +84,12 @@ CGFloat const PanelAnimationDuration = 0.2; return splitViewController; } ++ (nullable instancetype)setupAsMainController { + MVMCoreUISplitViewController *splitViewController = [self setup]; + [[MVMCoreUISession sharedGlobal] setupAsStandardLoadViewDelegate:splitViewController]; + return splitViewController; +} + #pragma mark - Main Subclassables - (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth { @@ -932,39 +934,4 @@ CGFloat const PanelAnimationDuration = 0.2; } } -#pragma mark - MVMCoreLoadingOverlayDelegateProtocol - -- (nonnull UIViewController *)getLoadingViewController { - - if (self.loadingViewController) { - return self.loadingViewController; - } else { - MFLoadingViewController *loadingViewController = [[MFLoadingViewController alloc] init]; - UIView *view = loadingViewController.view; - view.hidden = YES; - self.loadingViewController = loadingViewController; - - // Adds the overlay to the screen. - UIView *viewToPresentOn = self.view; - - [self addChildViewController:loadingViewController]; - [viewToPresentOn addSubview:view]; - [loadingViewController didMoveToParentViewController:self]; - - // Sets the constraints for autolayout - [view setTranslatesAutoresizingMaskIntoConstraints:NO]; - [NSLayoutConstraint constraintPinSubviewToSuperview:view]; - return loadingViewController; - } -} - -- (void)beginningLoading { - // Disables the UI when loading - self.view.userInteractionEnabled = NO; -} - -- (void)finishedLoading { - self.view.userInteractionEnabled = YES; -} - @end diff --git a/MVMCoreUI/Session/MVMCoreUISession.h b/MVMCoreUI/Session/MVMCoreUISession.h index 4589e12e..505f7008 100644 --- a/MVMCoreUI/Session/MVMCoreUISession.h +++ b/MVMCoreUI/Session/MVMCoreUISession.h @@ -29,6 +29,9 @@ NS_ASSUME_NONNULL_BEGIN // Allows a global overload of the title view of navigation item. - (nullable UIView *)titleViewForController:(nonnull MFViewController *)controller; +// Sets up the session as delegate for standard load view controller. Pass the view controller that will be used to present and will be disabled when load view is presented. +- (void)setupAsStandardLoadViewDelegate:(nonnull UIViewController *)mainViewController; + @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/Session/MVMCoreUISession.m b/MVMCoreUI/Session/MVMCoreUISession.m index afe99b76..238a7b2d 100644 --- a/MVMCoreUI/Session/MVMCoreUISession.m +++ b/MVMCoreUI/Session/MVMCoreUISession.m @@ -7,6 +7,16 @@ // #import "MVMCoreUISession.h" +#import "MFLoadingViewController.h" +#import "NSLayoutConstraint+MFConvenience.h" +@import MVMCore.MVMCoreObject; + +@interface MVMCoreUISession () + +@property (weak, nonatomic, nullable) UIViewController *mainViewController; +@property (weak, nonatomic, nullable) MFLoadingViewController *loadingViewController; + +@end @implementation MVMCoreUISession @@ -14,4 +24,43 @@ return nil; } +- (void)setupAsStandardLoadViewDelegate:(nonnull UIViewController *)mainViewController { + self.mainViewController = mainViewController; + [MVMCoreObject sharedInstance].loadingProtocol = self; +} + +#pragma mark - MVMCoreLoadingOverlayDelegateProtocol + +- (nonnull UIViewController *)getLoadingViewController { + + if (self.loadingViewController) { + return self.loadingViewController; + } else { + MFLoadingViewController *loadingViewController = [[MFLoadingViewController alloc] init]; + UIView *view = loadingViewController.view; + view.hidden = YES; + self.loadingViewController = loadingViewController; + + // Adds the overlay to the screen. + UIView *viewToPresentOn = self.mainViewController.view; + [self.mainViewController addChildViewController:loadingViewController]; + [viewToPresentOn addSubview:view]; + [loadingViewController didMoveToParentViewController:self.mainViewController]; + + // Sets the constraints for autolayout + [view setTranslatesAutoresizingMaskIntoConstraints:NO]; + [NSLayoutConstraint constraintPinSubviewToSuperview:view]; + return loadingViewController; + } +} + +- (void)beginningLoading { + // Disables the UI when loading + self.mainViewController.view.userInteractionEnabled = NO; +} + +- (void)finishedLoading { + self.mainViewController.view.userInteractionEnabled = YES; +} + @end From 91d485f852fecf474390e4e09b31b0d2e847c8ed Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 28 Jan 2019 15:46:55 -0500 Subject: [PATCH 6/8] Convenience for setting up session and core object --- MVMCoreUI.xcodeproj/project.pbxproj | 20 +++++++------- MVMCoreUI/MVMCoreUI.h | 1 + MVMCoreUI/OtherHandlers/MVMCoreUIObject.h | 17 ++++++++++++ MVMCoreUI/OtherHandlers/MVMCoreUIObject.m | 26 +++++++++++++++++++ .../MVMCoreUISession.h | 0 .../MVMCoreUISession.m | 0 6 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 MVMCoreUI/OtherHandlers/MVMCoreUIObject.h create mode 100644 MVMCoreUI/OtherHandlers/MVMCoreUIObject.m rename MVMCoreUI/{Session => OtherHandlers}/MVMCoreUISession.h (100%) rename MVMCoreUI/{Session => OtherHandlers}/MVMCoreUISession.m (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index e7706a6d..63689c74 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m */; }; + D28B4F8A21FF967C00712C7A /* MVMCoreUIObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D28B4F8821FF967C00712C7A /* MVMCoreUIObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D28B4F8B21FF967C00712C7A /* MVMCoreUIObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D28B4F8921FF967C00712C7A /* MVMCoreUIObject.m */; }; D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */; }; D29770C921F7C4AE00B2F0D0 /* TopLabelsView.h in Headers */ = {isa = PBXBuildFile; fileRef = D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */; settings = {ATTRIBUTES = (Public, ); }; }; D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D29770EE21F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m */; }; @@ -146,6 +148,8 @@ /* Begin PBXFileReference section */ D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationControllerViewController.h; sourceTree = ""; }; D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationControllerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUINavigationControllerViewController.m; sourceTree = ""; }; + D28B4F8821FF967C00712C7A /* MVMCoreUIObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIObject.h; sourceTree = ""; }; + D28B4F8921FF967C00712C7A /* MVMCoreUIObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIObject.m; sourceTree = ""; }; D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopLabelsView.m; sourceTree = ""; }; D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopLabelsView.h; sourceTree = ""; }; D29770EE21F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopLabelsAndBottomButtonsTableViewController.m; sourceTree = ""; }; @@ -319,7 +323,6 @@ children = ( D29DF31421ECECA7003B2FB9 /* SupportingFiles */, D29DF27021E79B2C003B2FB9 /* OtherHandlers */, - D29DF14E21E693BB003B2FB9 /* Session */, D29DF13A21E68682003B2FB9 /* Utility */, D29DF13321E68604003B2FB9 /* Styles */, D29DF11021E6805F003B2FB9 /* Categories */, @@ -472,15 +475,6 @@ path = Sizing; sourceTree = ""; }; - D29DF14E21E693BB003B2FB9 /* Session */ = { - isa = PBXGroup; - children = ( - D29DF27721E7A533003B2FB9 /* MVMCoreUISession.h */, - D29DF27821E7A533003B2FB9 /* MVMCoreUISession.m */, - ); - path = Session; - sourceTree = ""; - }; D29DF16821E69E1F003B2FB9 /* Buttons */ = { isa = PBXGroup; children = ( @@ -574,6 +568,10 @@ D29DF27021E79B2C003B2FB9 /* OtherHandlers */ = { isa = PBXGroup; children = ( + D28B4F8821FF967C00712C7A /* MVMCoreUIObject.h */, + D28B4F8921FF967C00712C7A /* MVMCoreUIObject.m */, + D29DF27721E7A533003B2FB9 /* MVMCoreUISession.h */, + D29DF27821E7A533003B2FB9 /* MVMCoreUISession.m */, D29DF27321E79E81003B2FB9 /* MVMCoreUILoggingHandler.h */, D29DF27421E79E81003B2FB9 /* MVMCoreUILoggingHandler.m */, D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */, @@ -689,6 +687,7 @@ D29DF16221E69996003B2FB9 /* MFViewController.h in Headers */, D29DF13121E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.h in Headers */, D29DF2C421E7BF57003B2FB9 /* MFTabBarSwipeAnimator.h in Headers */, + D28B4F8A21FF967C00712C7A /* MVMCoreUIObject.h in Headers */, D29DF2CA21E7BFC8003B2FB9 /* MFSizeThreshold.h in Headers */, D29770F821F7C73800B2F0D0 /* PrimaryButtonView.h in Headers */, D29DF28021E7AA51003B2FB9 /* MVMCoreUIDetailViewProtocol.h in Headers */, @@ -813,6 +812,7 @@ D29DF25421E6A177003B2FB9 /* MFMdnTextField.m in Sources */, D29DF26521E6A9D9003B2FB9 /* MFTransparentGIFView.m in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, + D28B4F8B21FF967C00712C7A /* MVMCoreUIObject.m in Sources */, D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */, diff --git a/MVMCoreUI/MVMCoreUI.h b/MVMCoreUI/MVMCoreUI.h index 6e2f0ea3..7821c746 100644 --- a/MVMCoreUI/MVMCoreUI.h +++ b/MVMCoreUI/MVMCoreUI.h @@ -25,6 +25,7 @@ FOUNDATION_EXPORT const unsigned char MVMCoreUIVersionString[]; #import #pragma mark - OtherHandlers +#import #import #import diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIObject.h b/MVMCoreUI/OtherHandlers/MVMCoreUIObject.h new file mode 100644 index 00000000..f9a3510d --- /dev/null +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIObject.h @@ -0,0 +1,17 @@ +// +// MVMCoreUIObject.h +// MVMCoreUI +// +// Created by Scott Pfeil on 1/28/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MVMCoreUIObject : MVMCoreObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIObject.m b/MVMCoreUI/OtherHandlers/MVMCoreUIObject.m new file mode 100644 index 00000000..4c601e46 --- /dev/null +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIObject.m @@ -0,0 +1,26 @@ +// +// MVMCoreUIObject.m +// MVMCoreUI +// +// Created by Scott Pfeil on 1/28/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +#import "MVMCoreUIObject.h" +#import "MVMCoreUISession.h" +#import "MVMCoreUIViewControllerMappingObject.h" +#import "MVMCoreUILoggingHandler.h" + +@implementation MVMCoreUIObject + +- (void)defaultInitialSetup { + self.cache = [[MVMCoreCache alloc] init]; + self.sessionHandler = [[MVMCoreSessionTimeHandler alloc] init]; + self.actionHandler = [[MVMCoreActionHandler alloc] init]; + + self.session = [[MVMCoreUISession alloc] init]; + self.viewControllerMapping = [[MVMCoreUIViewControllerMappingObject alloc] init]; + self.loggingDelegate = [[MVMCoreUILoggingHandler alloc] init]; +} + +@end diff --git a/MVMCoreUI/Session/MVMCoreUISession.h b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h similarity index 100% rename from MVMCoreUI/Session/MVMCoreUISession.h rename to MVMCoreUI/OtherHandlers/MVMCoreUISession.h diff --git a/MVMCoreUI/Session/MVMCoreUISession.m b/MVMCoreUI/OtherHandlers/MVMCoreUISession.m similarity index 100% rename from MVMCoreUI/Session/MVMCoreUISession.m rename to MVMCoreUI/OtherHandlers/MVMCoreUISession.m From 3f482625a52e29288cf0d534b5878a9b04ad546d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 28 Jan 2019 17:44:58 -0500 Subject: [PATCH 7/8] replace type --- .../TopLabelsAndBottomButtonsTableViewController.m | 2 +- .../BaseControllers/TopLabelsAndBottomButtonsViewController.m | 2 +- MVMCoreUI/Molecules/TopLabelsView.h | 2 +- MVMCoreUI/Molecules/TopLabelsView.m | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m index ed6d242d..0d4f7ebe 100644 --- a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m +++ b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsTableViewController.m @@ -145,7 +145,7 @@ } - (void)setHeadlineAndMessage { - [self.topLabelsView setWtihJSON:[self mapForTopLabels]]; + [self.topLabelsView setWithJSON:[self mapForTopLabels]]; } - (void)updateViewConstraints { diff --git a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m index 66216dd2..cc7cd627 100644 --- a/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m +++ b/MVMCoreUI/BaseControllers/TopLabelsAndBottomButtonsViewController.m @@ -113,7 +113,7 @@ self.topLabelsView = topLabelsView; topView = topLabelsView; self.topView = topView; - [topLabelsView setWtihJSON:[self mapForTopLabels]]; + [topLabelsView setWithJSON:[self mapForTopLabels]]; } [self.contentView addSubview:topView]; [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView)]]; diff --git a/MVMCoreUI/Molecules/TopLabelsView.h b/MVMCoreUI/Molecules/TopLabelsView.h index 3e2f8d2d..04c2d8be 100644 --- a/MVMCoreUI/Molecules/TopLabelsView.h +++ b/MVMCoreUI/Molecules/TopLabelsView.h @@ -51,6 +51,6 @@ - (void)setRightConstant:(CGFloat)rightConstant; // Sets up the ui based on the json -- (void)setWtihJSON:(nullable NSDictionary *)json; +- (void)setWithJSON:(nullable NSDictionary *)json; @end diff --git a/MVMCoreUI/Molecules/TopLabelsView.m b/MVMCoreUI/Molecules/TopLabelsView.m index ccd45caf..028fcf32 100644 --- a/MVMCoreUI/Molecules/TopLabelsView.m +++ b/MVMCoreUI/Molecules/TopLabelsView.m @@ -215,7 +215,7 @@ self.rightConstraintSeparator.constant = rightConstant; } -- (void)setWtihJSON:(nullable NSDictionary *)json { +- (void)setWithJSON:(nullable NSDictionary *)json { [self setHeadlineString:[json stringForKey:KeyTitle] messageString:[json stringForKey:KeyMessage]]; UIColor *textColor = [self colorForTopLabelsWithJSON:json]; self.headlineLabel.textColor = textColor; From ddd5970546a82883f27e65de1aef9b2e0b8720db Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 29 Jan 2019 10:02:47 -0500 Subject: [PATCH 8/8] exposed the loading --- MVMCoreUI/OtherHandlers/MVMCoreUISession.h | 2 ++ MVMCoreUI/OtherHandlers/MVMCoreUISession.m | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h index 505f7008..72e7728e 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h @@ -12,6 +12,7 @@ @class MVMCoreUISplitViewController; @class MFViewController; @class MVMCoreUINavigationControllerViewController; +@class MFLoadingViewController; NS_ASSUME_NONNULL_BEGIN @interface MVMCoreUISession : MVMCoreSessionObject @@ -19,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic, nullable) MVMCoreUITopAlertView *topAlertView; @property (weak, nonatomic, nullable) MVMCoreUISplitViewController *splitViewController; @property (weak, nonatomic, nullable) MVMCoreUINavigationControllerViewController *navigationController; +@property (weak, nonatomic, nullable) MFLoadingViewController *loadingViewController; // for handscroll Animation on subclasses of MFScrollingViewController @property (assign, nonatomic) BOOL enableHandScrollAnimation; diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUISession.m b/MVMCoreUI/OtherHandlers/MVMCoreUISession.m index 238a7b2d..433b1ab1 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUISession.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUISession.m @@ -14,7 +14,6 @@ @interface MVMCoreUISession () @property (weak, nonatomic, nullable) UIViewController *mainViewController; -@property (weak, nonatomic, nullable) MFLoadingViewController *loadingViewController; @end