diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 04c2b811..9c0e69fa 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 01DF55E021F8FAA800CC099B /* MFTextFieldListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */; }; 01DF567021FA5AB300CC099B /* TextFieldListFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */; }; 01E569D3223FFFA500327251 /* ThreeLayerViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 18423C7E22E07B260069C7B7 /* MultiLabelListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */; }; B8200E152280C4CF007245F4 /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E142280C4CF007245F4 /* ProgressBar.swift */; }; B8200E192281DC1A007245F4 /* ProgressBarWithLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */; }; D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -187,6 +188,7 @@ 01CA51B4229716F60071A6EE /* Switch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Switch.swift; sourceTree = ""; }; 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFTextFieldListView.swift; sourceTree = ""; }; 01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldListFormViewController.swift; sourceTree = ""; }; + 18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiLabelListItem.swift; sourceTree = ""; }; B8200E142280C4CF007245F4 /* ProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = ""; }; B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBarWithLabel.swift; sourceTree = ""; }; D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationController.h; sourceTree = ""; }; @@ -459,6 +461,7 @@ D29DF10E21E67A77003B2FB9 /* Molecules */ = { isa = PBXGroup; children = ( + 18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */, 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */, D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */, D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, @@ -901,6 +904,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 18423C7E22E07B260069C7B7 /* MultiLabelListItem.swift in Sources */, D29DF32121ED0CBA003B2FB9 /* LabelView.m in Sources */, DBC4391822442197001AB423 /* CaretView.swift in Sources */, D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */, diff --git a/MVMCoreUI/Molecules/MultiLabelListItem.swift b/MVMCoreUI/Molecules/MultiLabelListItem.swift new file mode 100644 index 00000000..adbd7cf3 --- /dev/null +++ b/MVMCoreUI/Molecules/MultiLabelListItem.swift @@ -0,0 +1,48 @@ +// +// multiLabelListItem.swift +// MVMCoreUI +// +// Created by Kanamarlapudi, Vasavi on 15/7/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +@objcMembers public class MultiLabelListItem: ViewConstrainingView { + + var moleculestackview = MoleculeStackView(frame: .zero) + + open override func needsToBeConstrained() -> Bool { + return true + } + + open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { + super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) + + let moleculestackjson = json?.optionalDictionaryForKey("moleculeStack") + moleculestackview.setWithJSON(moleculestackjson, delegateObject: delegateObject, additionalData: additionalData) + moleculestackview.useStackSpacingBeforeFirstItem = true + } + + override open func setupView() { + super.setupView() + addSubview(moleculestackview) + + moleculestackview.leftAnchor.constraint(equalTo: self.leftAnchor).isActive = true + moleculestackview.topAnchor.constraint(equalTo: self.topAnchor).isActive = true + let topleftwidthconstraint = NSLayoutConstraint(item: moleculestackview, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 0.5, constant: 0.0) + topleftwidthconstraint.priority = UILayoutPriority(100) + topleftwidthconstraint.isActive = true + moleculestackview.setContentHuggingPriority(UILayoutPriority(911), for: .horizontal) + moleculestackview.setContentHuggingPriority(UILayoutPriority(911), for: .vertical) + + var bottomconstraint = bottomAnchor.constraint(equalTo: moleculestackview.bottomAnchor, constant: PaddingTwo) + bottomconstraint.priority = UILayoutPriority(249) + bottomconstraint.isActive = true + bottomAnchor.constraint(greaterThanOrEqualTo: moleculestackview.bottomAnchor, constant: PaddingTwo).isActive = true + bottomconstraint = bottomAnchor.constraint(equalTo: moleculestackview.bottomAnchor, constant: PaddingTwo) + bottomconstraint.priority = UILayoutPriority(249) + bottomconstraint.isActive = true + bottomAnchor.constraint(greaterThanOrEqualTo: moleculestackview.bottomAnchor, constant: PaddingTwo).isActive = true + } +} diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m b/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m index 67279c6e..b45255e4 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m @@ -48,6 +48,7 @@ @"image": MFLoadImageView.class, @"leftRightLabelView": LeftRightLabelView.class, @"moduleMolecule": ModuleMolecule.class, + @"multiLabelListItem": MultiLabelListItem.class, @"headlineBody": HeadlineBody.class } mutableCopy]; });