From 1207b28540ea76d72f44f1976b4f6bf948c191d3 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Thu, 24 Jan 2019 15:24:14 -0500 Subject: [PATCH] MVMCoreUITextFormViewController --- MVMCoreUI.xcodeproj/project.pbxproj | 10 ++-- MVMCoreUI/Atoms/Views/test123.swift | 13 ----- .../MFTextFieldListView.swift | 0 .../MVMCoreUIViewControllerMappingObject.m | 6 ++- .../MVMCoreUITextFormViewController.swift | 52 +++++++++++++++++++ 5 files changed, 62 insertions(+), 19 deletions(-) delete mode 100644 MVMCoreUI/Atoms/Views/test123.swift rename MVMCoreUI/{Atoms/Views => Molecules}/MFTextFieldListView.swift (100%) create mode 100644 MVMCoreUI/Templates/MVMCoreUITextFormViewController.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index dcc6ccd0..d33b166b 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 01DF55E021F8FAA800CC099B /* MFTextFieldListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */; }; - 01DF560621F8FB2500CC099B /* test123.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF560521F8FB2500CC099B /* test123.swift */; }; + 01DF566C21FA2ACE00CC099B /* MVMCoreUITextFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF566B21FA2ACE00CC099B /* MVMCoreUITextFormViewController.swift */; }; 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 */; }; @@ -145,7 +145,7 @@ /* Begin PBXFileReference section */ 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFTextFieldListView.swift; sourceTree = ""; }; - 01DF560521F8FB2500CC099B /* test123.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = test123.swift; sourceTree = ""; }; + 01DF566B21FA2ACE00CC099B /* MVMCoreUITextFormViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUITextFormViewController.swift; 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 = ""; }; @@ -340,6 +340,7 @@ children = ( D29DF0E021E4F3B6003B2FB9 /* MVMCoreUILargeHeaderSingleLabelTemplate.h */, D29DF0E121E4F3B6003B2FB9 /* MVMCoreUILargeHeaderSingleLabelTemplate.m */, + 01DF566B21FA2ACE00CC099B /* MVMCoreUITextFormViewController.swift */, ); path = Templates; sourceTree = ""; @@ -366,6 +367,7 @@ D29DF10E21E67A77003B2FB9 /* Molecules */ = { isa = PBXGroup; children = ( + 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */, D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */, D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, D29770F621F7C73800B2F0D0 /* PrimaryButtonView.h */, @@ -499,7 +501,6 @@ D29DF17D21E69E26003B2FB9 /* Views */ = { isa = PBXGroup; children = ( - 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */, D29DF17E21E69E2E003B2FB9 /* MFView.h */, D29DF17F21E69E2E003B2FB9 /* MFView.m */, D29DF28521E7AC2B003B2FB9 /* MFLabel.h */, @@ -529,7 +530,6 @@ D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */, D29770FB21F7C77400B2F0D0 /* TextFieldView.h */, D29770FA21F7C77400B2F0D0 /* TextFieldView.m */, - 01DF560521F8FB2500CC099B /* test123.swift */, ); path = Views; sourceTree = ""; @@ -803,6 +803,7 @@ D29DF2C521E7BF57003B2FB9 /* MFTabBarSwipeAnimator.m in Sources */, D29DF2B421E7B76D003B2FB9 /* MFLoadingSpinner.m in Sources */, D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */, + 01DF566C21FA2ACE00CC099B /* MVMCoreUITextFormViewController.swift in Sources */, D29DF12E21E6851E003B2FB9 /* MVMCoreUITopAlertView.m in Sources */, D29DF2CF21E7C104003B2FB9 /* MFLoadingViewController.m in Sources */, D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, @@ -816,7 +817,6 @@ D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */, D29DF18121E69E50003B2FB9 /* MFView.m in Sources */, - 01DF560621F8FB2500CC099B /* test123.swift in Sources */, D29DF18321E69E54003B2FB9 /* SeparatorView.m in Sources */, D29DF17A21E69E1F003B2FB9 /* MFCustomButton.m in Sources */, D29DF26121E6A985003B2FB9 /* MFLoadImageView.m in Sources */, diff --git a/MVMCoreUI/Atoms/Views/test123.swift b/MVMCoreUI/Atoms/Views/test123.swift deleted file mode 100644 index 120000cd..00000000 --- a/MVMCoreUI/Atoms/Views/test123.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// test123.swift -// MVMCoreUI -// -// Created by Suresh, Kamlesh on 1/23/19. -// Copyright © 2019 Verizon Wireless. All rights reserved. -// - -import UIKit - -class test123: NSObject { - -} diff --git a/MVMCoreUI/Atoms/Views/MFTextFieldListView.swift b/MVMCoreUI/Molecules/MFTextFieldListView.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/MFTextFieldListView.swift rename to MVMCoreUI/Molecules/MFTextFieldListView.swift diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIViewControllerMappingObject.m b/MVMCoreUI/OtherHandlers/MVMCoreUIViewControllerMappingObject.m index 3f73bf85..07f1f8b0 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIViewControllerMappingObject.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIViewControllerMappingObject.m @@ -9,6 +9,7 @@ #import "MVMCoreUIViewControllerMappingObject.h" #import #import "MVMCoreUILargeHeaderSingleLabelTemplate.h" +#import @implementation MVMCoreUIViewControllerMappingObject @@ -18,7 +19,10 @@ static dispatch_once_t onceToken; static NSMutableDictionary *viewControllerMapping; dispatch_once(&onceToken, ^{ - viewControllerMapping = [@{ @"LargeHeaderSingleLabel": [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MVMCoreUILargeHeaderSingleLabelTemplate class]]} mutableCopy]; + viewControllerMapping = [@{ + @"LargeHeaderSingleLabel": [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MVMCoreUILargeHeaderSingleLabelTemplate class]], + @"textListForm" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MVMCoreUITextFormViewController class]] + } mutableCopy]; }); return viewControllerMapping; } diff --git a/MVMCoreUI/Templates/MVMCoreUITextFormViewController.swift b/MVMCoreUI/Templates/MVMCoreUITextFormViewController.swift new file mode 100644 index 00000000..1188a299 --- /dev/null +++ b/MVMCoreUI/Templates/MVMCoreUITextFormViewController.swift @@ -0,0 +1,52 @@ +// +// MVMCoreUITextFormViewController.swift +// MVMCoreUI +// +// Created by Suresh, Kamlesh on 1/24/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +public class MVMCoreUITextFormViewController: TopLabelsAndBottomButtonsViewController { + + + public var textFieldListView: MFTextFieldListView? + + public override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + public override func updateViews() { + super.updateViews() + } + + public override func newDataBuildScreen() { + super.newDataBuildScreen() + topLabelsView?.separatorView?.isHidden = true + } + + public override func buildViewsBetweenLabelsAndButtons() -> [UIView]? { + var viewList: [UIView] = [] + + if let textFieldsList = loadObject?.pageJSON?.arrayForKey("textFieldList") as? [[String: Any]] { + let textFieldListView = MFTextFieldListView(textFieldMapList: textFieldsList, + parentViewContoller: self, + primaryButton: self.primaryButton) + self.textFieldListView = textFieldListView + viewList.append(textFieldListView) + } + return viewList + } + + public override func handleOpenPage(for requestParameters: MVMCoreRequestParameters, actionInformation: [AnyHashable : Any]?, additionalData: [AnyHashable : Any]?) { + textFieldListView?.addParams(requestParameters: requestParameters) + super.handleOpenPage(for: requestParameters, actionInformation: actionInformation, additionalData: additionalData) + } + + public override func spaceAboveBetweenView() -> NSNumber? { + return PaddingFour as NSNumber + } + +}