Merge branch 'develop' into feature/standardlistitemwithimage
# Conflicts: # MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m
This commit is contained in:
commit
55f20e0633
@ -162,6 +162,7 @@
|
|||||||
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */; };
|
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */; };
|
||||||
D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* StandardHeaderView.swift */; };
|
D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* StandardHeaderView.swift */; };
|
||||||
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; };
|
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; };
|
||||||
|
D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; };
|
||||||
D2C5001821F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
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 */; };
|
D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */; };
|
||||||
D2E1FADB2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */; };
|
D2E1FADB2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */; };
|
||||||
@ -335,6 +336,7 @@
|
|||||||
D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackCenteredTemplate.swift; sourceTree = "<group>"; };
|
D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackCenteredTemplate.swift; sourceTree = "<group>"; };
|
||||||
D2A514662213885800345BFB /* StandardHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardHeaderView.swift; sourceTree = "<group>"; };
|
D2A514662213885800345BFB /* StandardHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardHeaderView.swift; sourceTree = "<group>"; };
|
||||||
D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerViewController.swift; sourceTree = "<group>"; };
|
D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerViewController.swift; sourceTree = "<group>"; };
|
||||||
|
D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = "<group>"; };
|
||||||
D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = "<group>"; };
|
D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = "<group>"; };
|
||||||
D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = "<group>"; };
|
D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = "<group>"; };
|
||||||
D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIDelegateObject.swift; sourceTree = "<group>"; };
|
D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIDelegateObject.swift; sourceTree = "<group>"; };
|
||||||
@ -474,6 +476,7 @@
|
|||||||
B8200E142280C4CF007245F4 /* ProgressBar.swift */,
|
B8200E142280C4CF007245F4 /* ProgressBar.swift */,
|
||||||
B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */,
|
B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */,
|
||||||
D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */,
|
D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */,
|
||||||
|
D2A638FC22CA98280052ED1F /* HeadlineBody.swift */,
|
||||||
);
|
);
|
||||||
path = Molecules;
|
path = Molecules;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -954,6 +957,7 @@
|
|||||||
D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */,
|
D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */,
|
||||||
016A1071228122180009D605 /* SwitchLineItem.swift in Sources */,
|
016A1071228122180009D605 /* SwitchLineItem.swift in Sources */,
|
||||||
D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */,
|
D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */,
|
||||||
|
D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */,
|
||||||
D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */,
|
D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */,
|
||||||
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */,
|
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */,
|
||||||
DB06250B2293456500B72DD3 /* LeftRightLabelView.swift in Sources */,
|
DB06250B2293456500B72DD3 /* LeftRightLabelView.swift in Sources */,
|
||||||
|
|||||||
@ -341,6 +341,25 @@ public typealias ActionBlock = () -> Void
|
|||||||
standardFontSize = 0
|
standardFontSize = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///Appends an external link image to the end of the attributed string.
|
||||||
|
public func addExternalLinkIcon() {
|
||||||
|
|
||||||
|
let size = round(font.pointSize * 0.8)
|
||||||
|
|
||||||
|
guard let attributedText = self.attributedText else { return }
|
||||||
|
|
||||||
|
let fullString = NSMutableAttributedString(attributedString: attributedText)
|
||||||
|
|
||||||
|
let imageAttachment = NSTextAttachment()
|
||||||
|
imageAttachment.image = MVMCoreUIUtility.imageNamed("externalLink")
|
||||||
|
imageAttachment.bounds = CGRect(x: 0, y: 0, width: size, height: size)
|
||||||
|
|
||||||
|
fullString.append(NSAttributedString(string: " "))
|
||||||
|
fullString.append(NSAttributedString(attachment: imageAttachment))
|
||||||
|
self.attributedText = fullString
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Atomization
|
// MARK: - Atomization
|
||||||
@ -370,6 +389,10 @@ extension Label {
|
|||||||
public func alignment() -> UIStackView.Alignment {
|
public func alignment() -> UIStackView.Alignment {
|
||||||
return .leading
|
return .leading
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func copyBackgroundColor() -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Multi-Action Functionality
|
// MARK: - Multi-Action Functionality
|
||||||
|
|||||||
@ -47,6 +47,10 @@
|
|||||||
|
|
||||||
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
||||||
|
|
||||||
|
- (void)reset {
|
||||||
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||||
self.json = json;
|
self.json = json;
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,14 @@
|
|||||||
@property (nullable, strong, nonatomic) IBOutlet NSLayoutConstraint *topPinLow;
|
@property (nullable, strong, nonatomic) IBOutlet NSLayoutConstraint *topPinLow;
|
||||||
@property (nullable, strong, nonatomic) IBOutlet NSLayoutConstraint *bottomPinLow;
|
@property (nullable, strong, nonatomic) IBOutlet NSLayoutConstraint *bottomPinLow;
|
||||||
|
|
||||||
|
/// In updateView, will set horizontal padding to default if set to YES.
|
||||||
// In updateView, will set horizontal padding to default if set to YES.
|
|
||||||
@property (nonatomic) BOOL updateViewHorizontalDefaults;
|
@property (nonatomic) BOOL updateViewHorizontalDefaults;
|
||||||
|
|
||||||
|
/// A molecule if we constrain one.
|
||||||
|
@property (weak, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule;
|
||||||
|
|
||||||
|
/// A flag for if we should add a molecule from json.
|
||||||
|
@property (nonatomic) BOOL shouldSetupMoleculeFromJSON;
|
||||||
|
|
||||||
// Returns an empty view
|
// Returns an empty view
|
||||||
+ (nonnull ViewConstrainingView *)emptyView;
|
+ (nonnull ViewConstrainingView *)emptyView;
|
||||||
@ -44,6 +48,8 @@
|
|||||||
// Can be initialized with a molecule to constrain
|
// Can be initialized with a molecule to constrain
|
||||||
- (nullable instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment;
|
- (nullable instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment;
|
||||||
|
|
||||||
|
#pragma mark - Constraining
|
||||||
|
|
||||||
// Use these to sets the constants, because subclasses may align differently.
|
// Use these to sets the constants, because subclasses may align differently.
|
||||||
- (void)setPinConstantsWithInsets:(UIEdgeInsets)insets;
|
- (void)setPinConstantsWithInsets:(UIEdgeInsets)insets;
|
||||||
- (void)setTopPinConstant:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right;
|
- (void)setTopPinConstant:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right;
|
||||||
@ -63,9 +69,6 @@
|
|||||||
// Resets all the constraints to default.
|
// Resets all the constraints to default.
|
||||||
- (void)resetConstraints;
|
- (void)resetConstraints;
|
||||||
|
|
||||||
// For setting up the view.
|
|
||||||
- (void)setupView;
|
|
||||||
|
|
||||||
// Add a view to be constrained in this view.
|
// Add a view to be constrained in this view.
|
||||||
- (void)addConstrainedView:(nonnull UIView *)view;
|
- (void)addConstrainedView:(nonnull UIView *)view;
|
||||||
|
|
||||||
|
|||||||
@ -9,12 +9,14 @@
|
|||||||
#import "ViewConstrainingView.h"
|
#import "ViewConstrainingView.h"
|
||||||
@import MVMCore.MVMCoreConstants;
|
@import MVMCore.MVMCoreConstants;
|
||||||
@import MVMCore.MVMCoreDispatchUtility;
|
@import MVMCore.MVMCoreDispatchUtility;
|
||||||
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
#import "NSLayoutConstraint+MFConvenience.h"
|
#import "NSLayoutConstraint+MFConvenience.h"
|
||||||
#import "MFStyler.h"
|
#import "MFStyler.h"
|
||||||
|
#import "MVMCoreUIConstants.h"
|
||||||
|
#import "MVMCoreUIMoleculeMappingObject.h"
|
||||||
|
|
||||||
@interface ViewConstrainingView ()
|
@interface ViewConstrainingView ()
|
||||||
@property (weak, nullable, nonatomic) UIView *constrainedView;
|
@property (weak, nullable, nonatomic) UIView *constrainedView;
|
||||||
@property (weak, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ViewConstrainingView
|
@implementation ViewConstrainingView
|
||||||
@ -130,10 +132,12 @@
|
|||||||
|
|
||||||
- (void)show {
|
- (void)show {
|
||||||
self.topPin.active = YES;
|
self.topPin.active = YES;
|
||||||
|
self.topPinLow.active = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)hide {
|
- (void)hide {
|
||||||
self.topPin.active = NO;
|
self.topPin.active = NO;
|
||||||
|
self.topPinLow.active = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resetConstraints {
|
- (void)resetConstraints {
|
||||||
@ -279,6 +283,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)shouldSetVerticalMargins:(BOOL)shouldSet {
|
- (void)shouldSetVerticalMargins:(BOOL)shouldSet {
|
||||||
|
BOOL useStandardSpacing = shouldSet;
|
||||||
|
if (shouldSet && [self.molecule respondsToSelector:@selector(useStandardConstraints)]) {
|
||||||
|
useStandardSpacing = [((UIView <MVMCoreUIViewConstrainingProtocol>*)self.molecule) useStandardConstraints];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useStandardSpacing) {
|
||||||
|
[self setTopPinConstant:PaddingDefaultVerticalSpacing];
|
||||||
|
[self setBottomPinConstant:PaddingDefaultVerticalSpacing];
|
||||||
|
} else {
|
||||||
|
[self setTopPinConstant:0];
|
||||||
|
[self setBottomPinConstant:0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - MVMCoreViewProtocol
|
#pragma mark - MVMCoreViewProtocol
|
||||||
@ -312,8 +328,8 @@
|
|||||||
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
||||||
|
|
||||||
- (void)reset {
|
- (void)reset {
|
||||||
if ([self.constrainedView respondsToSelector:@selector(reset)]) {
|
if ([self.molecule respondsToSelector:@selector(reset)]) {
|
||||||
[self.constrainedView performSelector:@selector(reset)];
|
[self.molecule performSelector:@selector(reset)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,11 +339,23 @@
|
|||||||
|
|
||||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||||
[super setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
|
[super setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
|
||||||
if (self.molecule) {
|
|
||||||
[self.molecule setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
|
[self.molecule setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
|
||||||
|
if (self.shouldSetupMoleculeFromJSON && !self.molecule) {
|
||||||
|
NSDictionary *moleculeJSON = [json dict:KeyMolecule];
|
||||||
|
if (moleculeJSON) {
|
||||||
|
UIView <MVMCoreUIMoleculeViewProtocol>*molecule = [[MVMCoreUIMoleculeMappingObject sharedMappingObject] createMoleculeForJSON:moleculeJSON delegateObject:delegateObject constrainIfNeeded:true];
|
||||||
|
if (molecule) {
|
||||||
|
[self insertSubview:molecule atIndex:0];
|
||||||
|
[self pinViewToSuperView:molecule];
|
||||||
|
}
|
||||||
|
self.molecule = molecule;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (self.constrainedView && (![self.constrainedView respondsToSelector:@selector(copyBackgroundColor)] || [self.constrainedView performSelector:@selector(copyBackgroundColor)])) {
|
if (self.molecule) {
|
||||||
self.backgroundColor = self.constrainedView.backgroundColor;
|
if ([self.molecule respondsToSelector:@selector(copyBackgroundColor)] && [self.molecule performSelector:@selector(copyBackgroundColor)]) {
|
||||||
|
self.backgroundColor = self.molecule.backgroundColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,6 +68,10 @@ import UIKit
|
|||||||
return 42
|
return 42
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func copyBackgroundColor() -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Constraining
|
// MARK: - Constraining
|
||||||
func setupButton() {
|
func setupButton() {
|
||||||
if let primaryButton = primaryButton, !subviews.contains(primaryButton) {
|
if let primaryButton = primaryButton, !subviews.contains(primaryButton) {
|
||||||
|
|||||||
105
MVMCoreUI/Molecules/HeadlineBody.swift
Normal file
105
MVMCoreUI/Molecules/HeadlineBody.swift
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
//
|
||||||
|
// HeadlineBody.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Scott Pfeil on 7/1/19.
|
||||||
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
open class HeadlineBody: ViewConstrainingView {
|
||||||
|
let headlineLabel = Label.commonLabelH2(true)
|
||||||
|
let messageLabel = Label.commonLabelB2(true)
|
||||||
|
var spaceBetweenLabels: NSLayoutConstraint?
|
||||||
|
var leftConstraintTitle: NSLayoutConstraint?
|
||||||
|
var rightConstraintTitle: NSLayoutConstraint?
|
||||||
|
var leftConstraintMessage: NSLayoutConstraint?
|
||||||
|
var rightConstraintMessage: NSLayoutConstraint?
|
||||||
|
|
||||||
|
// MARK: - MVMCoreViewProtocol
|
||||||
|
open override func updateView(_ size: CGFloat) {
|
||||||
|
super.updateView(size)
|
||||||
|
headlineLabel.updateView(size)
|
||||||
|
messageLabel.updateView(size)
|
||||||
|
setSpacing()
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func setupView() {
|
||||||
|
super.setupView()
|
||||||
|
guard subviews.count == 0 else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
backgroundColor = .clear
|
||||||
|
clipsToBounds = true
|
||||||
|
|
||||||
|
addSubview(headlineLabel)
|
||||||
|
addSubview(messageLabel)
|
||||||
|
|
||||||
|
headlineLabel.setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
||||||
|
messageLabel.setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
||||||
|
setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
||||||
|
|
||||||
|
topPin = headlineLabel.topAnchor.constraint(equalTo: topAnchor, constant: 0)
|
||||||
|
topPin?.isActive = true
|
||||||
|
|
||||||
|
spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: PaddingTwo)
|
||||||
|
spaceBetweenLabels?.isActive = true
|
||||||
|
|
||||||
|
leftConstraintTitle = headlineLabel.leftAnchor.constraint(equalTo: leftAnchor)
|
||||||
|
leftConstraintTitle?.isActive = true
|
||||||
|
|
||||||
|
rightConstraintTitle = rightAnchor.constraint(equalTo: headlineLabel.rightAnchor)
|
||||||
|
rightConstraintTitle?.isActive = true
|
||||||
|
|
||||||
|
leftConstraintMessage = messageLabel.leftAnchor.constraint(equalTo: leftAnchor)
|
||||||
|
leftConstraintMessage?.isActive = true
|
||||||
|
|
||||||
|
rightConstraintMessage = rightAnchor.constraint(equalTo: messageLabel.rightAnchor)
|
||||||
|
rightConstraintMessage?.isActive = true
|
||||||
|
|
||||||
|
bottomPin = bottomAnchor.constraint(equalTo: messageLabel.bottomAnchor, constant: 0)
|
||||||
|
bottomPin?.isActive = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Constraining
|
||||||
|
public func setSpacing() {
|
||||||
|
if headlineLabel.hasText && messageLabel.hasText {
|
||||||
|
spaceBetweenLabels?.constant = PaddingTwo
|
||||||
|
} else {
|
||||||
|
spaceBetweenLabels?.constant = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func setLeftPinConstant(_ constant: CGFloat) {
|
||||||
|
leftConstraintTitle?.constant = constant
|
||||||
|
leftConstraintMessage?.constant = constant
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func setRightPinConstant(_ constant: CGFloat) {
|
||||||
|
rightConstraintTitle?.constant = constant
|
||||||
|
rightConstraintMessage?.constant = constant
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
|
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
|
|
||||||
|
let headlineJSON = json?.optionalDictionaryForKey("headline")
|
||||||
|
headlineLabel.setWithJSON(headlineJSON, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
|
let bodyJSON = json?.optionalDictionaryForKey("body")
|
||||||
|
messageLabel.setWithJSON(bodyJSON, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
headlineLabel.styleH2(true)
|
||||||
|
messageLabel.styleB2(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
return 58
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -10,11 +10,11 @@ import UIKit
|
|||||||
|
|
||||||
open class ModuleMolecule: ViewConstrainingView {
|
open class ModuleMolecule: ViewConstrainingView {
|
||||||
|
|
||||||
open var molecule: (UIView & MVMCoreUIMoleculeViewProtocol)?
|
open var moduleMolecule: (UIView & MVMCoreUIMoleculeViewProtocol)?
|
||||||
|
|
||||||
open override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
super.updateView(size)
|
super.updateView(size)
|
||||||
molecule?.updateView(size)
|
moduleMolecule?.updateView(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
@ -26,26 +26,25 @@ open class ModuleMolecule: ViewConstrainingView {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if molecule == nil {
|
if moduleMolecule == nil {
|
||||||
if let moleculeView = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(forJSON: module, delegateObject: delegateObject, constrainIfNeeded: true) {
|
if let moleculeView = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(forJSON: module, delegateObject: delegateObject, constrainIfNeeded: true) {
|
||||||
addSubview(moleculeView)
|
addSubview(moleculeView)
|
||||||
NSLayoutConstraint.activate(Array(NSLayoutConstraint.pinView(toSuperview: moleculeView, useMargins: false).values))
|
NSLayoutConstraint.activate(Array(NSLayoutConstraint.pinView(toSuperview: moleculeView, useMargins: false).values))
|
||||||
molecule = moleculeView
|
moduleMolecule = moleculeView
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
molecule?.setWithJSON(module, delegateObject: delegateObject, additionalData: additionalData)
|
moduleMolecule?.setWithJSON(module, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func setAsMolecule() {
|
open override func setAsMolecule() {
|
||||||
super.setAsMolecule()
|
super.setAsMolecule()
|
||||||
updateViewHorizontalDefaults = false
|
moduleMolecule?.setAsMolecule?()
|
||||||
molecule?.setAsMolecule?()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
molecule?.reset?()
|
moduleMolecule?.reset?()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
@ -80,22 +79,22 @@ open class ModuleMolecule: ViewConstrainingView {
|
|||||||
|
|
||||||
// MARK: - MVMCoreUIViewConstrainingProtocol
|
// MARK: - MVMCoreUIViewConstrainingProtocol
|
||||||
open override func useStandardConstraints() -> Bool {
|
open override func useStandardConstraints() -> Bool {
|
||||||
return (molecule as? MVMCoreUIViewConstrainingProtocol)?.useStandardConstraints?() ?? true
|
return (moduleMolecule as? MVMCoreUIViewConstrainingProtocol)?.useStandardConstraints?() ?? true
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func alignHorizontal(_ alignment: UIStackView.Alignment) {
|
open override func alignHorizontal(_ alignment: UIStackView.Alignment) {
|
||||||
(molecule as? MVMCoreUIViewConstrainingProtocol)?.alignHorizontal?(alignment)
|
(moduleMolecule as? MVMCoreUIViewConstrainingProtocol)?.alignHorizontal?(alignment)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func alignVertical(_ alignment: UIStackView.Alignment) {
|
open override func alignVertical(_ alignment: UIStackView.Alignment) {
|
||||||
(molecule as? MVMCoreUIViewConstrainingProtocol)?.alignVertical?(alignment)
|
(moduleMolecule as? MVMCoreUIViewConstrainingProtocol)?.alignVertical?(alignment)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func shouldSetHorizontalMargins(_ shouldSet: Bool) {
|
open override func shouldSetHorizontalMargins(_ shouldSet: Bool) {
|
||||||
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(shouldSet)
|
(moduleMolecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(shouldSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func shouldSetVerticalMargins(_ shouldSet: Bool) {
|
open override func shouldSetVerticalMargins(_ shouldSet: Bool) {
|
||||||
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(shouldSet)
|
(moduleMolecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(shouldSet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,103 +8,24 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public class StandardFooterView: ViewConstrainingView {
|
open class StandardFooterView: ViewConstrainingView {
|
||||||
let twoButtonView = TwoButtonView(frame: .zero)
|
open override func setupView() {
|
||||||
var textButton = MFTextButton(nil, constrainHeight: true, forWidth: MVMCoreUIUtility.getWidth())
|
|
||||||
var spaceBetweenButtons: NSLayoutConstraint?
|
|
||||||
var leftConstraintTwoButton: NSLayoutConstraint?
|
|
||||||
var rightConstraintTwoButton: NSLayoutConstraint?
|
|
||||||
var leftConstraintTextButton: NSLayoutConstraint?
|
|
||||||
var rightConstraintTextButton: NSLayoutConstraint?
|
|
||||||
var centerAlignTextButton: NSLayoutConstraint?
|
|
||||||
private var heightConstraint: NSLayoutConstraint?
|
|
||||||
|
|
||||||
public override func updateView(_ size: CGFloat) {
|
|
||||||
super.updateView(size)
|
|
||||||
twoButtonView.updateView(size)
|
|
||||||
textButton.updateView(size)
|
|
||||||
setSpacing()
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func setupView() {
|
|
||||||
super.setupView()
|
super.setupView()
|
||||||
guard subviews.count == 0 else {
|
shouldSetupMoleculeFromJSON = true
|
||||||
return
|
|
||||||
}
|
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
backgroundColor = .clear
|
|
||||||
clipsToBounds = true
|
|
||||||
setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
|
||||||
setContentCompressionResistancePriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
|
||||||
|
|
||||||
addSubview(twoButtonView)
|
|
||||||
addSubview(textButton)
|
|
||||||
|
|
||||||
topPin = twoButtonView.topAnchor.constraint(equalTo: topAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
topPin?.isActive = true
|
|
||||||
|
|
||||||
spaceBetweenButtons = textButton.topAnchor.constraint(equalTo: twoButtonView.bottomAnchor, constant: PaddingTwo)
|
|
||||||
spaceBetweenButtons?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintTwoButton = twoButtonView.leftAnchor.constraint(equalTo: layoutMarginsGuide.leftAnchor)
|
|
||||||
leftConstraintTwoButton?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintTwoButton = layoutMarginsGuide.rightAnchor.constraint(equalTo: twoButtonView.rightAnchor)
|
|
||||||
rightConstraintTwoButton?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintTextButton = textButton.leftAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.leftAnchor)
|
|
||||||
leftConstraintTextButton?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintTextButton = layoutMarginsGuide.rightAnchor.constraint(greaterThanOrEqualTo: textButton.rightAnchor)
|
|
||||||
rightConstraintTextButton?.isActive = true
|
|
||||||
|
|
||||||
centerAlignTextButton = textButton.centerXAnchor.constraint(equalTo: centerXAnchor)
|
|
||||||
centerAlignTextButton?.isActive = true
|
|
||||||
|
|
||||||
bottomPin = bottomAnchor.constraint(equalTo: textButton.bottomAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
bottomPin?.isActive = true
|
|
||||||
|
|
||||||
heightConstraint = heightAnchor.constraint(equalToConstant: 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func setSpacing() {
|
open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
|
||||||
if !(twoButtonView.heightConstraint?.isActive ?? false) && textButton.title(for: UIControl.State.normal)?.count ?? 0 > 0 {
|
|
||||||
spaceBetweenButtons?.constant = PaddingTwo
|
|
||||||
show()
|
|
||||||
} else if !(twoButtonView.heightConstraint?.isActive ?? false) || textButton.title(for: UIControl.State.normal)?.count ?? 0 > 0 {
|
|
||||||
spaceBetweenButtons?.constant = 0
|
|
||||||
show()
|
|
||||||
} else {
|
|
||||||
hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func show() {
|
|
||||||
super.show()
|
|
||||||
heightConstraint?.isActive = false
|
|
||||||
topPin?.isActive = true
|
|
||||||
layoutIfNeeded()
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func hide() {
|
|
||||||
super.hide()
|
|
||||||
heightConstraint?.isActive = true
|
|
||||||
topPin?.isActive = false
|
|
||||||
layoutIfNeeded()
|
|
||||||
}
|
|
||||||
|
|
||||||
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
|
||||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
twoButtonView.setWithJSON(json?.optionalDictionaryForKey("twoButtonView"), delegateObject: delegateObject, additionalData: additionalData)
|
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(false)
|
||||||
textButton.setWithJSON(json?.optionalDictionaryForKey("textButton"), delegateObject: delegateObject, additionalData: additionalData)
|
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false)
|
||||||
}
|
shouldSetVerticalMargins(true)
|
||||||
|
shouldSetHorizontalMargins(true)
|
||||||
public override func reset() {
|
|
||||||
twoButtonView.reset()
|
|
||||||
textButton.reset()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
||||||
|
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
||||||
|
}
|
||||||
return 42
|
return 42
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,126 +9,45 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public class StandardHeaderView: ViewConstrainingView {
|
public class StandardHeaderView: ViewConstrainingView {
|
||||||
let headlineLabel = Label.commonLabelH2(true)
|
|
||||||
let messageLabel = Label.commonLabelB2(true)
|
|
||||||
var separatorView: SeparatorView?
|
var separatorView: SeparatorView?
|
||||||
var spaceBetweenLabels: NSLayoutConstraint?
|
|
||||||
var leftConstraintTitle: NSLayoutConstraint?
|
|
||||||
var rightConstraintTitle: NSLayoutConstraint?
|
|
||||||
var leftConstraintMessage: NSLayoutConstraint?
|
|
||||||
var rightConstraintMessage: NSLayoutConstraint?
|
|
||||||
private var heightConstraint: NSLayoutConstraint?
|
|
||||||
|
|
||||||
// MARK: - MVMCoreViewProtocol
|
// MARK: - MVMCoreViewProtocol
|
||||||
public override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
super.updateView(size)
|
super.updateView(size)
|
||||||
headlineLabel.updateView(size)
|
|
||||||
messageLabel.updateView(size)
|
|
||||||
separatorView?.updateView(size)
|
separatorView?.updateView(size)
|
||||||
setSpacing()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func setupView() {
|
public override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
if separatorView == nil {
|
shouldSetupMoleculeFromJSON = true
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
if separatorView == nil, let separatorView = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot, withHorizontalPadding: 0) {
|
||||||
backgroundColor = .clear
|
separatorView.setAsHeavy()
|
||||||
clipsToBounds = true
|
addSubview(separatorView)
|
||||||
|
self.separatorView = separatorView
|
||||||
addSubview(headlineLabel)
|
|
||||||
addSubview(messageLabel)
|
|
||||||
|
|
||||||
headlineLabel.setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
|
||||||
messageLabel.setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
|
||||||
setContentHuggingPriority(UILayoutPriority.required, for: NSLayoutConstraint.Axis.vertical)
|
|
||||||
|
|
||||||
topPin = headlineLabel.topAnchor.constraint(equalTo: topAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
topPin?.isActive = true
|
|
||||||
|
|
||||||
spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: PaddingTwo)
|
|
||||||
spaceBetweenLabels?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintTitle = headlineLabel.leftAnchor.constraint(equalTo: leftAnchor)
|
|
||||||
leftConstraintTitle?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintTitle = rightAnchor.constraint(equalTo: headlineLabel.rightAnchor)
|
|
||||||
rightConstraintTitle?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintMessage = messageLabel.leftAnchor.constraint(equalTo: leftAnchor)
|
|
||||||
leftConstraintMessage?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintMessage = rightAnchor.constraint(equalTo: messageLabel.rightAnchor)
|
|
||||||
rightConstraintMessage?.isActive = true
|
|
||||||
|
|
||||||
bottomPin = bottomAnchor.constraint(equalTo: messageLabel.bottomAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
bottomPin?.isActive = true
|
|
||||||
|
|
||||||
heightConstraint = heightAnchor.constraint(equalToConstant: 0)
|
|
||||||
heightConstraint?.priority = UILayoutPriority(rawValue: 950)
|
|
||||||
|
|
||||||
if let separatorView = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot, withHorizontalPadding: 0) {
|
|
||||||
separatorView.setAsHeavy()
|
|
||||||
addSubview(separatorView)
|
|
||||||
self.separatorView = separatorView
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Constraining
|
|
||||||
public func setSpacing() {
|
|
||||||
if headlineLabel.hasText && messageLabel.hasText {
|
|
||||||
spaceBetweenLabels?.constant = PaddingTwo
|
|
||||||
show()
|
|
||||||
} else if headlineLabel.hasText || messageLabel.hasText {
|
|
||||||
spaceBetweenLabels?.constant = 0
|
|
||||||
show()
|
|
||||||
} else {
|
|
||||||
hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func show() {
|
|
||||||
super.show()
|
|
||||||
heightConstraint?.isActive = false
|
|
||||||
layoutIfNeeded()
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func hide() {
|
|
||||||
super.hide()
|
|
||||||
heightConstraint?.isActive = true
|
|
||||||
layoutIfNeeded()
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func setLeftPinConstant(_ constant: CGFloat) {
|
public override func setLeftPinConstant(_ constant: CGFloat) {
|
||||||
leftConstraintTitle?.constant = constant
|
super.setLeftPinConstant(constant)
|
||||||
leftConstraintMessage?.constant = constant
|
|
||||||
separatorView?.leftPin?.constant = constant
|
separatorView?.leftPin?.constant = constant
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func setRightPinConstant(_ constant: CGFloat) {
|
public override func setRightPinConstant(_ constant: CGFloat) {
|
||||||
rightConstraintTitle?.constant = constant
|
super.setRightPinConstant(constant)
|
||||||
rightConstraintMessage?.constant = constant
|
|
||||||
separatorView?.rightPin?.constant = constant
|
separatorView?.rightPin?.constant = constant
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
if let colorString = json?.optionalStringForKey("contentColor") {
|
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(false)
|
||||||
let color = UIColor.mfGet(forHex: colorString)
|
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false)
|
||||||
headlineLabel.textColor = color
|
shouldSetVerticalMargins(true)
|
||||||
messageLabel.textColor = color
|
shouldSetHorizontalMargins(true)
|
||||||
separatorView?.backgroundColor = color
|
|
||||||
}
|
|
||||||
|
|
||||||
let headlineJSON = json?.optionalDictionaryForKey("headline")
|
|
||||||
headlineLabel.setWithJSON(headlineJSON, delegateObject: delegateObject, additionalData: additionalData)
|
|
||||||
let bodyJSON = json?.optionalDictionaryForKey("body")
|
|
||||||
messageLabel.setWithJSON(bodyJSON, delegateObject: delegateObject, additionalData: additionalData)
|
|
||||||
if let separatorJSON = json?.optionalDictionaryForKey("separator") {
|
if let separatorJSON = json?.optionalDictionaryForKey("separator") {
|
||||||
separatorView?.setWithJSON(separatorJSON, delegateObject: delegateObject, additionalData: additionalData)
|
separatorView?.setWithJSON(separatorJSON, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
if separatorView?.isHidden ?? true {
|
if separatorView?.isHidden ?? true {
|
||||||
bottomPin?.constant = 0
|
bottomPin?.constant = 0
|
||||||
} else {
|
} else {
|
||||||
@ -137,14 +56,15 @@ public class StandardHeaderView: ViewConstrainingView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
backgroundColor = .clear
|
super.reset()
|
||||||
headlineLabel.styleH2(true)
|
|
||||||
messageLabel.styleB2(true)
|
|
||||||
separatorView?.setAsHeavy()
|
separatorView?.setAsHeavy()
|
||||||
separatorView?.show()
|
separatorView?.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
||||||
|
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
||||||
|
}
|
||||||
return 121
|
return 121
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,8 @@
|
|||||||
@"leftRightLabelView": LeftRightLabelView.class,
|
@"leftRightLabelView": LeftRightLabelView.class,
|
||||||
@"listItemWithImage": ListItemWithImage.class,
|
@"listItemWithImage": ListItemWithImage.class,
|
||||||
@"image": MFLoadImageView.class,
|
@"image": MFLoadImageView.class,
|
||||||
@"moduleMolecule": ModuleMolecule.class
|
@"moduleMolecule": ModuleMolecule.class,
|
||||||
|
@"headlineBody": HeadlineBody.class
|
||||||
} mutableCopy];
|
} mutableCopy];
|
||||||
});
|
});
|
||||||
return mapping;
|
return mapping;
|
||||||
|
|||||||
6
MVMCoreUI/SupportingFiles/Media.xcassets/Contents.json
Normal file
6
MVMCoreUI/SupportingFiles/Media.xcassets/Contents.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
23
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json
vendored
Normal file
23
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "exportBlack.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "exportBlack@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "exportBlack@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 345 B |
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 589 B |
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 869 B |
Loading…
Reference in New Issue
Block a user