diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 1bc3548b..b4295986 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -18,7 +18,6 @@ 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, ); }; }; @@ -168,6 +167,7 @@ D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; }; D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390022CBB1820052ED1F /* Carousel.swift */; }; D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */; }; + D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */; }; D2C5001821F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */; }; D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */; }; @@ -195,7 +195,6 @@ 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 = ""; }; @@ -349,6 +348,7 @@ D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = ""; }; D2A6390022CBB1820052ED1F /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = ""; }; D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeCollectionViewCell.swift; sourceTree = ""; }; + D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageHeadlineBody.swift; sourceTree = ""; }; D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = ""; }; D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = ""; }; D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scroller.swift; sourceTree = ""; }; @@ -476,7 +476,6 @@ D29DF10E21E67A77003B2FB9 /* Molecules */ = { isa = PBXGroup; children = ( - 18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */, 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */, D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */, D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, @@ -499,6 +498,7 @@ D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */, D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */, D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */, + D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */, ); path = Molecules; sourceTree = ""; @@ -927,7 +927,6 @@ 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 */, @@ -999,6 +998,7 @@ D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */, D2E1FADF2268B8E700AEFD8C /* ThreeLayerTableViewController.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, + D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */, D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */, diff --git a/MVMCoreUI/Atoms/Views/MFLoadImageView.swift b/MVMCoreUI/Atoms/Views/MFLoadImageView.swift index 1debda74..c0066afe 100644 --- a/MVMCoreUI/Atoms/Views/MFLoadImageView.swift +++ b/MVMCoreUI/Atoms/Views/MFLoadImageView.swift @@ -215,6 +215,7 @@ import UIKit // MARK: - MVMCoreUIMoleculeViewProtocol functions open override func setAsMolecule() { addSizeConstraintsForAspectRatio = true + pinEdges(.all) } public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Atoms/Views/MFRadioButton.h b/MVMCoreUI/Atoms/Views/MFRadioButton.h index 86837256..c5e053c0 100644 --- a/MVMCoreUI/Atoms/Views/MFRadioButton.h +++ b/MVMCoreUI/Atoms/Views/MFRadioButton.h @@ -30,7 +30,6 @@ typedef void (^PerformActionForRadioButton)(void); @property (nullable, copy, nonatomic) PerformActionForRadioButton performActionForCheck; typedef void (^CircleSelectedClosure)(_Nonnull id sender); - @property (nonatomic, strong, nullable) UIColor* fillColor; @property (nonatomic, strong, nullable) UIColor* borderColor; @property (nonatomic) CGFloat circleBorderWidth; @@ -38,11 +37,16 @@ typedef void (^CircleSelectedClosure)(_Nonnull id sender); @property (nonatomic, copy, nullable) CircleSelectedClosure handleSelectionBlock; @property (nonatomic) CGFloat circleDiameter; @property (nonatomic, nullable, strong, readonly) CAShapeLayer * myCircle; - +@property (nullable, weak, nonatomic) UIView *outerCircleView; +@property (nullable, weak, nonatomic) UIView *innerCircleView; @property (nonatomic, strong, nullable) NSLayoutConstraint *heightConstraint; @property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint; @property (nonatomic) BOOL respondsToTapGesture; @property (nonatomic, getter = isSelected) BOOL selected; +@property (strong, nonatomic) NSLayoutConstraint *innerHeightConstarint; +@property (strong, nonatomic) NSLayoutConstraint *innerWidthConstarint; +@property (strong, nonatomic) NSLayoutConstraint *outerHeightConstarint; +@property (strong, nonatomic) NSLayoutConstraint *outerWidthConstarint; // Set line width manually - (void)setCheckMarkLineWidth:(CGFloat)lineWidth; diff --git a/MVMCoreUI/Atoms/Views/MFRadioButton.m b/MVMCoreUI/Atoms/Views/MFRadioButton.m index d1a9ee03..06f6c3a0 100644 --- a/MVMCoreUI/Atoms/Views/MFRadioButton.m +++ b/MVMCoreUI/Atoms/Views/MFRadioButton.m @@ -12,11 +12,6 @@ static CGFloat const DefaultOuterCircleSize = 31; static CGFloat const DefaultInnerCircleSize = 19; -@interface MFRadioButton () -@property (nullable, weak, nonatomic) UIView *outerCircleView; -@property (nullable, weak, nonatomic) UIView *innerCircleView; -@end - @implementation MFRadioButton @@ -64,9 +59,11 @@ static CGFloat const DefaultInnerCircleSize = 19; [outerCircleView.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES; [outerCircleView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES; [outerCircleView.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES; - - [outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES; - [outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES; + + self.outerHeightConstarint = [outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize]; + self.outerHeightConstarint.active = YES; + self.outerWidthConstarint = [outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize]; + self.outerWidthConstarint.active = YES; UIView *innerCircleView = [[UIView alloc] init]; [outerCircleView addSubview:innerCircleView]; @@ -76,8 +73,11 @@ static CGFloat const DefaultInnerCircleSize = 19; [innerCircleView.centerXAnchor constraintEqualToAnchor:outerCircleView.centerXAnchor].active = YES; [innerCircleView.centerYAnchor constraintEqualToAnchor:outerCircleView.centerYAnchor].active = YES; - [innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES; - [innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES; + + self.innerHeightConstarint = [innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize]; + self.innerHeightConstarint.active = YES; + self.innerWidthConstarint = [innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize]; + self.innerWidthConstarint.active = YES; outerCircleView.userInteractionEnabled = NO; innerCircleView.userInteractionEnabled = NO; diff --git a/MVMCoreUI/Atoms/Views/MFView.m b/MVMCoreUI/Atoms/Views/MFView.m index 937da3f2..740c5ad5 100644 --- a/MVMCoreUI/Atoms/Views/MFView.m +++ b/MVMCoreUI/Atoms/Views/MFView.m @@ -46,6 +46,10 @@ #pragma mark - MVMCoreUIMoleculeViewProtocol +- (void)setAsMolecule { + self.translatesAutoresizingMaskIntoConstraints = NO; +} + - (void)reset { self.backgroundColor = [UIColor clearColor]; } diff --git a/MVMCoreUI/Atoms/Views/SeparatorView.m b/MVMCoreUI/Atoms/Views/SeparatorView.m index 2d01e6d2..a666d450 100644 --- a/MVMCoreUI/Atoms/Views/SeparatorView.m +++ b/MVMCoreUI/Atoms/Views/SeparatorView.m @@ -114,6 +114,11 @@ } else { self.hidden = YES; } + + NSString *colorString = [json string:KeyBackgroundColor]; + if (colorString) { + self.backgroundColor = [UIColor mfGetColorForHex:colorString]; + } } #pragma mark - helper diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m index 4b4ad4eb..f46916b3 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m @@ -347,9 +347,6 @@ } } -- (void)setAsMolecule { -} - - (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData { [super setWithJSON:json delegateObject:delegateObject additionalData:additionalData]; diff --git a/MVMCoreUI/Molecules/Carousel.swift b/MVMCoreUI/Molecules/Carousel.swift index db796782..d0efcce3 100644 --- a/MVMCoreUI/Molecules/Carousel.swift +++ b/MVMCoreUI/Molecules/Carousel.swift @@ -255,6 +255,10 @@ extension Carousel: UICollectionViewDelegateFlowLayout { let itemWidth = collectionView.bounds.width * itemWidthPercent return CGSize(width: itemWidth, height: collectionView.bounds.height) } + + public func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + (cell as? MoleculeCollectionViewCell)?.setPeaking(false, animated: false) + } } extension Carousel: UICollectionViewDataSource { diff --git a/MVMCoreUI/Molecules/HeadlineBody.swift b/MVMCoreUI/Molecules/HeadlineBody.swift index 9eaa602f..d3c37261 100644 --- a/MVMCoreUI/Molecules/HeadlineBody.swift +++ b/MVMCoreUI/Molecules/HeadlineBody.swift @@ -11,6 +11,7 @@ import UIKit open class HeadlineBody: ViewConstrainingView { let headlineLabel = Label.commonLabelH2(true) let messageLabel = Label.commonLabelB2(true) + var spaceBetweenLabelsConstant = PaddingTwo var spaceBetweenLabels: NSLayoutConstraint? var leftConstraintTitle: NSLayoutConstraint? var rightConstraintTitle: NSLayoutConstraint? @@ -44,7 +45,7 @@ open class HeadlineBody: ViewConstrainingView { topPin = headlineLabel.topAnchor.constraint(equalTo: topAnchor, constant: 0) topPin?.isActive = true - spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: PaddingTwo) + spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: spaceBetweenLabelsConstant) spaceBetweenLabels?.isActive = true leftConstraintTitle = headlineLabel.leftAnchor.constraint(equalTo: leftAnchor) @@ -66,7 +67,7 @@ open class HeadlineBody: ViewConstrainingView { // MARK: - Constraining public func setSpacing() { if headlineLabel.hasText && messageLabel.hasText { - spaceBetweenLabels?.constant = PaddingTwo + spaceBetweenLabels?.constant = spaceBetweenLabelsConstant } else { spaceBetweenLabels?.constant = 0 } @@ -96,6 +97,7 @@ open class HeadlineBody: ViewConstrainingView { super.reset() headlineLabel.styleH2(true) messageLabel.styleB2(true) + spaceBetweenLabelsConstant = PaddingTwo } public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Molecules/ImageHeadlineBody.swift b/MVMCoreUI/Molecules/ImageHeadlineBody.swift new file mode 100644 index 00000000..f1e295fe --- /dev/null +++ b/MVMCoreUI/Molecules/ImageHeadlineBody.swift @@ -0,0 +1,85 @@ +// +// ImageHeadlineBody.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 8/1/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +@objcMembers open class ImageHeadlineBody: ViewConstrainingView { + let headlineBody = HeadlineBody(frame: .zero) + let imageView = MFLoadImageView() + var constraintBetweenImageLabelsConstant: CGFloat = 16 + var constraintBetweenImageLabels: NSLayoutConstraint? + + // MARK: - MFViewProtocol + + open override func setupView() { + guard subviews.count == 0 else { + return + } + MVMCoreUIUtility.setMarginsFor(self, leading: 0, top: 0, trailing: 0, bottom: 0) + headlineBody.headlineLabel.styleB1(true) + headlineBody.spaceBetweenLabelsConstant = 0 + addSubview(headlineBody) + addSubview(imageView) + + NSLayoutConstraint.pinViewTop(toSuperview: headlineBody, useMargins: true, constant: 0).isActive = true + NSLayoutConstraint.pinViewRight(toSuperview: headlineBody, useMargins: true, constant: 0).isActive = true + layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: headlineBody.bottomAnchor).isActive = true + var constraint = NSLayoutConstraint.pinViewBottom(toSuperview: headlineBody, useMargins: true, constant: 0) + constraint.priority = .defaultLow + constraint.isActive = true + + imageView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true + NSLayoutConstraint.pinViewLeft(toSuperview: imageView, useMargins: true, constant: 0).isActive = true + imageView.topAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.topAnchor).isActive = true + layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: imageView.bottomAnchor).isActive = true + constraint = NSLayoutConstraint.pinViewBottom(toSuperview: imageView, useMargins: true, constant: 0) + constraint.priority = UILayoutPriority(rawValue: 200) + constraint.isActive = true + constraint = NSLayoutConstraint.pinViewTop(toSuperview: imageView, useMargins: true, constant: 0) + constraint.priority = UILayoutPriority(rawValue: 200) + constraint.isActive = true + + constraintBetweenImageLabels = headlineBody.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: constraintBetweenImageLabelsConstant) + constraintBetweenImageLabels?.isActive = true + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + headlineBody.updateView(size) + imageView.updateView(size) + } + + // MARK: - MVMCoreUIMoleculeViewProtocol + + open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) + headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData) + + let imageJSON = json?.optionalDictionaryForKey("image") + imageView.setWithJSON(imageJSON, delegateObject: delegateObject, additionalData: additionalData) + constraintBetweenImageLabels?.constant = imageJSON != nil ? constraintBetweenImageLabelsConstant : 0 + } + + open override func setAsMolecule() { + super.setAsMolecule() + headlineBody.setAsMolecule() + imageView.setAsMolecule() + } + + open override func reset() { + super.reset() + headlineBody.reset() + headlineBody.headlineLabel.styleB1(true) + headlineBody.spaceBetweenLabelsConstant = 0 + imageView.reset() + } + + public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 95 + } +} diff --git a/MVMCoreUI/Molecules/MVMCoreUIPageControl.m b/MVMCoreUI/Molecules/MVMCoreUIPageControl.m index 16783ca9..6648b513 100644 --- a/MVMCoreUI/Molecules/MVMCoreUIPageControl.m +++ b/MVMCoreUI/Molecules/MVMCoreUIPageControl.m @@ -297,7 +297,9 @@ static CGFloat const IndicatorRectangleHeight = 4; if (selectedIndex != NSNotFound) { self.currentPage = selectedIndex; [self sendActionsForControlEvents:UIControlEventValueChanged]; - self.pagingTouchBlock(self); + if (self.pagingTouchBlock) { + self.pagingTouchBlock(self); + } } } } @@ -351,7 +353,9 @@ static CGFloat const IndicatorRectangleHeight = 4; if ((index < self.numberOfPages && index >= 0) || self.alwaysSendingControlEvent) { [self setCurrentPage:index animated:NO]; [self sendActionsForControlEvents:UIControlEventValueChanged]; - self.pagingTouchBlock(self); + if (self.pagingTouchBlock) { + self.pagingTouchBlock(self); + } } } diff --git a/MVMCoreUI/Molecules/MoleculeTableViewCell.swift b/MVMCoreUI/Molecules/MoleculeTableViewCell.swift index 492e7d4d..c6241667 100644 --- a/MVMCoreUI/Molecules/MoleculeTableViewCell.swift +++ b/MVMCoreUI/Molecules/MoleculeTableViewCell.swift @@ -98,7 +98,7 @@ import UIKit } // Add the caret if there is an action and it's not declared hidden. - if let _ = json?.optionalDictionaryForKey("actionMap"), json!.boolForKey("hideArrow") { + if let _ = json?.optionalDictionaryForKey("actionMap"), !json!.boolForKey("hideArrow") { addCaretViewAccessory() } else { accessoryView = nil diff --git a/MVMCoreUI/Molecules/MultiLabelListItem.swift b/MVMCoreUI/Molecules/MultiLabelListItem.swift deleted file mode 100644 index adbd7cf3..00000000 --- a/MVMCoreUI/Molecules/MultiLabelListItem.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// 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 246e529c..41513bf0 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m @@ -49,12 +49,12 @@ @"image": MFLoadImageView.class, @"leftRightLabelView": LeftRightLabelView.class, @"moduleMolecule": ModuleMolecule.class, - @"multiLabelListItem": MultiLabelListItem.class, @"headlineBody": HeadlineBody.class, @"carousel": Carousel.class, @"carouselItem": MoleculeCollectionViewCell.class, @"barsPager": MVMCoreUIPageControl.class, - @"scroller": Scroller.class + @"scroller": Scroller.class, + @"imageHeadlineBody": ImageHeadlineBody.class } mutableCopy]; }); return mapping;