Switch molecule
This commit is contained in:
parent
9fd2d2cbda
commit
89b1c9a21b
@ -10,7 +10,7 @@
|
|||||||
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618A224BBE7700E1557D /* FormValidator.swift */; };
|
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618A224BBE7700E1557D /* FormValidator.swift */; };
|
||||||
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */; };
|
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */; };
|
||||||
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */; };
|
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */; };
|
||||||
016A1071228122180009D605 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016A1070228122180009D605 /* Switch.swift */; };
|
016A1071228122180009D605 /* SwitchLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016A1070228122180009D605 /* SwitchLineItem.swift */; };
|
||||||
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0198F79E225679870066C936 /* FormValidationProtocol.swift */; };
|
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0198F79E225679870066C936 /* FormValidationProtocol.swift */; };
|
||||||
0198F7A62256A80B0066C936 /* MFRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 0198F7A02256A80A0066C936 /* MFRadioButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
0198F7A62256A80B0066C936 /* MFRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 0198F7A02256A80A0066C936 /* MFRadioButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0198F7A22256A80A0066C936 /* MFRadioButton.m */; };
|
0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0198F7A22256A80A0066C936 /* MFRadioButton.m */; };
|
||||||
@ -171,7 +171,7 @@
|
|||||||
0105618A224BBE7700E1557D /* FormValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidator.swift; sourceTree = "<group>"; };
|
0105618A224BBE7700E1557D /* FormValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidator.swift; sourceTree = "<group>"; };
|
||||||
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+TextFields.swift"; sourceTree = "<group>"; };
|
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+TextFields.swift"; sourceTree = "<group>"; };
|
||||||
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+FormParams.swift"; sourceTree = "<group>"; };
|
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+FormParams.swift"; sourceTree = "<group>"; };
|
||||||
016A1070228122180009D605 /* Switch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Switch.swift; sourceTree = "<group>"; };
|
016A1070228122180009D605 /* SwitchLineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchLineItem.swift; sourceTree = "<group>"; };
|
||||||
0198F79E225679870066C936 /* FormValidationProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidationProtocol.swift; sourceTree = "<group>"; };
|
0198F79E225679870066C936 /* FormValidationProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidationProtocol.swift; sourceTree = "<group>"; };
|
||||||
0198F7A02256A80A0066C936 /* MFRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFRadioButton.h; sourceTree = "<group>"; };
|
0198F7A02256A80A0066C936 /* MFRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFRadioButton.h; sourceTree = "<group>"; };
|
||||||
0198F7A22256A80A0066C936 /* MFRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFRadioButton.m; sourceTree = "<group>"; };
|
0198F7A22256A80A0066C936 /* MFRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFRadioButton.m; sourceTree = "<group>"; };
|
||||||
@ -444,7 +444,7 @@
|
|||||||
D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */,
|
D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */,
|
||||||
D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */,
|
D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */,
|
||||||
D282AACA2243C61700C46919 /* ButtonView.swift */,
|
D282AACA2243C61700C46919 /* ButtonView.swift */,
|
||||||
016A1070228122180009D605 /* Switch.swift */,
|
016A1070228122180009D605 /* SwitchLineItem.swift */,
|
||||||
D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */,
|
D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */,
|
||||||
D2A514662213885800345BFB /* StandardHeaderView.swift */,
|
D2A514662213885800345BFB /* StandardHeaderView.swift */,
|
||||||
D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */,
|
D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */,
|
||||||
@ -920,7 +920,7 @@
|
|||||||
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */,
|
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */,
|
||||||
D29DF2C921E7BFC6003B2FB9 /* MFSizeObject.m in Sources */,
|
D29DF2C921E7BFC6003B2FB9 /* MFSizeObject.m in Sources */,
|
||||||
D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */,
|
D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */,
|
||||||
016A1071228122180009D605 /* Switch.swift in Sources */,
|
016A1071228122180009D605 /* SwitchLineItem.swift in Sources */,
|
||||||
D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */,
|
D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */,
|
||||||
D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */,
|
D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */,
|
||||||
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */,
|
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */,
|
||||||
@ -1102,9 +1102,9 @@
|
|||||||
BITCODE_GENERATION_MODE = bitcode;
|
BITCODE_GENERATION_MODE = bitcode;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Manual;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = FCMA4QKS77;
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
@ -1119,6 +1119,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCoreUI;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCoreUI;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@ -1132,9 +1133,9 @@
|
|||||||
BITCODE_GENERATION_MODE = bitcode;
|
BITCODE_GENERATION_MODE = bitcode;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Manual;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = FCMA4QKS77;
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
@ -1149,6 +1150,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCoreUI;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCoreUI;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
|||||||
@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
@interface MFTextButton ()
|
@interface MFTextButton ()
|
||||||
|
|
||||||
|
|
||||||
|
@property (nullable, nonatomic, strong) NSLayoutConstraint *widthConstraint;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MFTextButton
|
@implementation MFTextButton
|
||||||
@ -122,6 +125,7 @@
|
|||||||
} else {
|
} else {
|
||||||
[theButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
|
[theButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
|
||||||
}
|
}
|
||||||
|
theButton.widthConstraint = [theButton.widthAnchor constraintEqualToConstant:0];
|
||||||
[theButton updateView:width];
|
[theButton updateView:width];
|
||||||
return theButton;
|
return theButton;
|
||||||
}
|
}
|
||||||
@ -136,8 +140,10 @@
|
|||||||
[self setWithActionMap:json delegateObject:delegateObject additionalData:additionalData];
|
[self setWithActionMap:json delegateObject:delegateObject additionalData:additionalData];
|
||||||
if ([self titleForState:UIControlStateNormal].length == 0) {
|
if ([self titleForState:UIControlStateNormal].length == 0) {
|
||||||
self.heightConstraint.constant = 0;
|
self.heightConstraint.constant = 0;
|
||||||
|
self.widthConstraint.active = YES;
|
||||||
} else {
|
} else {
|
||||||
self.heightConstraint.constant = self.sizeObject.standardSize;
|
self.heightConstraint.constant = self.sizeObject.standardSize;
|
||||||
|
self.widthConstraint.active = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Switch.swift
|
// SwitchLineItem.swift
|
||||||
// MVMCoreUI
|
// MVMCoreUI
|
||||||
//
|
//
|
||||||
// Created by Priya on 5/6/19.
|
// Created by Priya on 5/6/19.
|
||||||
@ -12,9 +12,7 @@ import UIKit
|
|||||||
public var mvmSwitch = MVMCoreUISwitch()
|
public var mvmSwitch = MVMCoreUISwitch()
|
||||||
public var label = Label()
|
public var label = Label()
|
||||||
public var leftContainerView = UIView()
|
public var leftContainerView = UIView()
|
||||||
public var mfTextButton = MFTextButton()
|
public var mfTextButton = MFTextButton(nil, constrainHeight: true, forWidth: 0)
|
||||||
var topConstraint_Switch: NSLayoutConstraint?
|
|
||||||
var bottomConstraint_textBtn: NSLayoutConstraint?
|
|
||||||
var isRequired = false
|
var isRequired = false
|
||||||
var delegateObject: DelegateObject?
|
var delegateObject: DelegateObject?
|
||||||
|
|
||||||
@ -29,15 +27,16 @@ import UIKit
|
|||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
mvmSwitch.addTarget(self, action: #selector(Switch.switchChanged), for: .valueChanged)
|
mvmSwitch.addTarget(self, action: #selector(Switch.switchChanged), for: .valueChanged)
|
||||||
//leftContainerView.addSubview(mvmSwitch)
|
|
||||||
leftContainerView.addSubview(label)
|
leftContainerView.addSubview(label)
|
||||||
leftContainerView.addSubview(mfTextButton)
|
leftContainerView.addSubview(mfTextButton)
|
||||||
addSubview(leftContainerView)
|
addSubview(leftContainerView)
|
||||||
addSubview(mvmSwitch)
|
addSubview(mvmSwitch)
|
||||||
// label.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
|
leftContainerView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
mvmSwitch.translatesAutoresizingMaskIntoConstraints = false
|
mvmSwitch.translatesAutoresizingMaskIntoConstraints = false
|
||||||
mfTextButton.translatesAutoresizingMaskIntoConstraints = false;
|
mfTextButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
setupConstraints()
|
label.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
setupContainerConstraints()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func updateView(_ size: CGFloat) {
|
public override func updateView(_ size: CGFloat) {
|
||||||
@ -51,12 +50,8 @@ import UIKit
|
|||||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
isRequired = json?[KeyRequired] as? Bool ?? false
|
isRequired = json?[KeyRequired] as? Bool ?? false
|
||||||
self.delegateObject = delegateObject
|
self.delegateObject = delegateObject
|
||||||
if let dict = json?.optionalDictionaryForKey("label") {
|
label.setWithJSON(json?.optionalDictionaryForKey("label"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
label.setWithJSON(dict, delegateObject: delegateObject, additionalData: additionalData)
|
mfTextButton.setWithJSON(json?.optionalDictionaryForKey("textButton"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
|
||||||
if let dict = json?.optionalDictionaryForKey("textButton") {
|
|
||||||
mfTextButton.setWithJSON(dict, delegateObject: delegateObject, additionalData: additionalData)
|
|
||||||
}
|
|
||||||
if let delegateObject = delegateObject as? MVMCoreUIDelegateObject {
|
if let delegateObject = delegateObject as? MVMCoreUIDelegateObject {
|
||||||
FormValidator.setupValidation(molecule: self, delegate: delegateObject.formValidationProtocol)
|
FormValidator.setupValidation(molecule: self, delegate: delegateObject.formValidationProtocol)
|
||||||
}
|
}
|
||||||
@ -72,42 +67,66 @@ import UIKit
|
|||||||
if let offKnobColorString = json?.optionalStringForKey("offKnobTintColor") {
|
if let offKnobColorString = json?.optionalStringForKey("offKnobTintColor") {
|
||||||
mvmSwitch.offKnobTintColor = .mfGet(forHex: offKnobColorString)
|
mvmSwitch.offKnobTintColor = .mfGet(forHex: offKnobColorString)
|
||||||
}
|
}
|
||||||
// mvmSwitch.isOn = json?.optionalBoolForKey("state") ?? false
|
|
||||||
mvmSwitch.setState(json?.optionalBoolForKey("state") ?? false, animated: true)
|
mvmSwitch.setState(json?.optionalBoolForKey("state") ?? false, animated: true)
|
||||||
// updateContraints(json?.optionalDictionaryForKey("textButton"))
|
// if left container no width
|
||||||
leftContainerView.backgroundColor = .red
|
if (label.text?.count ?? 0) <= 0 && (mfTextButton.titleLabel?.text?.count ?? 0) <= 0 {
|
||||||
|
mvmSwitch.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 0).isActive = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupConstraints() {
|
func setupContainerConstraints() {
|
||||||
var constraint = label.topAnchor.constraint(equalTo: topAnchor)
|
leftContainerView.topAnchor.constraint(greaterThanOrEqualTo: topAnchor).isActive = true
|
||||||
constraint.priority = UILayoutPriority(rawValue: 249)
|
|
||||||
constraint.isActive = true
|
|
||||||
label.topAnchor.constraint(greaterThanOrEqualTo: topAnchor).isActive = true
|
|
||||||
label.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
|
||||||
NSLayoutConstraint.constraintPinSubview(mvmSwitch, pinCenterX: false, pinCenterY: true)
|
|
||||||
let _ = NSLayoutConstraint.constraintPinSubview(mvmSwitch, pinTop: true, topConstant: 0, topRelation: .greaterThanOrEqual, pinBottom: true, bottomConstant: 0, bottomRelation: .greaterThanOrEqual, pinLeft: false, leftConstant: 0, leftRelation: .equal, pinRight: true, rightConstant: 0, rightRelation: .equal)
|
|
||||||
// NSLayoutConstraint.constraintPinRightSubview(mvmSwitch, rightConstant: 0)
|
|
||||||
constraint = mvmSwitch.topAnchor.constraint(equalTo: topAnchor)
|
|
||||||
constraint.priority = UILayoutPriority(rawValue: 249)
|
|
||||||
constraint.isActive = true
|
|
||||||
constraint = bottomAnchor.constraint(equalTo: mvmSwitch.bottomAnchor)
|
|
||||||
constraint.priority = UILayoutPriority(rawValue: 249)
|
|
||||||
constraint.isActive = true
|
|
||||||
//topConstraint_Switch = dict?[ConstraintTop] as? NSLayoutConstraint
|
|
||||||
NSLayoutConstraint.constraintPinTopSubview(label, topConstant: 0)
|
|
||||||
|
|
||||||
// mvmSwitch.setContentHuggingPriority(UILayoutPriority(rawValue: 800), for: NSLayoutConstraint.Axis.horizontal)
|
var constraint = leftContainerView.topAnchor.constraint(equalTo: topAnchor)
|
||||||
|
|
||||||
mvmSwitch.leadingAnchor.constraint(greaterThanOrEqualTo: label.trailingAnchor).isActive = true
|
|
||||||
mvmSwitch.leadingAnchor.constraint(greaterThanOrEqualTo: mfTextButton.trailingAnchor).isActive = true
|
|
||||||
NSLayoutConstraint.constraintPinLeftSubview(mfTextButton, leftConstant: 0)
|
|
||||||
constraint = bottomAnchor.constraint(equalTo: mfTextButton.bottomAnchor)
|
|
||||||
constraint.priority = UILayoutPriority(249)
|
constraint.priority = UILayoutPriority(249)
|
||||||
constraint.isActive = true
|
constraint.isActive = true
|
||||||
bottomAnchor.constraint(greaterThanOrEqualTo: mfTextButton.bottomAnchor).isActive = true
|
|
||||||
label.bottomAnchor.constraint(equalTo: mfTextButton.topAnchor, constant: 0).isActive = true
|
mvmSwitch.topAnchor.constraint(greaterThanOrEqualTo: topAnchor).isActive = true
|
||||||
leftContainerView.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: NSLayoutConstraint.Axis.horizontal)
|
|
||||||
|
constraint = mvmSwitch.topAnchor.constraint(equalTo: topAnchor)
|
||||||
|
constraint.priority = UILayoutPriority(249)
|
||||||
|
constraint.isActive = true
|
||||||
|
|
||||||
|
trailingAnchor.constraint(equalTo: mvmSwitch.trailingAnchor).isActive = true
|
||||||
|
|
||||||
|
constraint = bottomAnchor.constraint(equalTo: mvmSwitch.bottomAnchor)
|
||||||
|
constraint.priority = UILayoutPriority(249)
|
||||||
|
constraint.isActive = true
|
||||||
|
|
||||||
|
bottomAnchor.constraint(greaterThanOrEqualTo: mvmSwitch.bottomAnchor).isActive = true
|
||||||
|
|
||||||
|
constraint = bottomAnchor.constraint(equalTo: leftContainerView.bottomAnchor)
|
||||||
|
constraint.isActive = true
|
||||||
|
|
||||||
|
bottomAnchor.constraint(greaterThanOrEqualTo: leftContainerView.bottomAnchor).isActive = true
|
||||||
|
leftContainerView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||||
|
|
||||||
|
NSLayoutConstraint.constraintPinSubview(leftContainerView, pinCenterX: false, pinCenterY: true)
|
||||||
|
constraint = mvmSwitch.leadingAnchor.constraint(greaterThanOrEqualTo: leftContainerView.trailingAnchor)
|
||||||
|
constraint.priority = UILayoutPriority(999)
|
||||||
|
constraint.isActive = true
|
||||||
|
NSLayoutConstraint.constraintPinSubview(mvmSwitch, pinCenterX: false, pinCenterY: true)
|
||||||
|
|
||||||
|
leftContainerView.topAnchor.constraint(equalTo: label.topAnchor).isActive = true
|
||||||
|
leftContainerView.trailingAnchor.constraint(greaterThanOrEqualTo: label.trailingAnchor).isActive = true
|
||||||
|
|
||||||
|
constraint = leftContainerView.trailingAnchor.constraint(equalTo: label.trailingAnchor)
|
||||||
|
constraint.priority = UILayoutPriority(249)
|
||||||
|
constraint.isActive = true
|
||||||
|
|
||||||
|
leftContainerView.trailingAnchor.constraint(greaterThanOrEqualTo: mfTextButton.trailingAnchor).isActive = true
|
||||||
|
|
||||||
|
constraint = leftContainerView.trailingAnchor.constraint(equalTo: mfTextButton.trailingAnchor)
|
||||||
|
constraint.priority = UILayoutPriority(249)
|
||||||
|
constraint.isActive = true
|
||||||
|
|
||||||
|
leftContainerView.bottomAnchor.constraint(equalTo: mfTextButton.bottomAnchor).isActive = true
|
||||||
|
mfTextButton.leadingAnchor.constraint(equalTo: leftContainerView.leadingAnchor).isActive = true
|
||||||
|
label.leadingAnchor.constraint(equalTo: leftContainerView.leadingAnchor).isActive = true
|
||||||
|
mfTextButton.topAnchor.constraint(equalTo: label.bottomAnchor).isActive = true
|
||||||
|
leftContainerView.setContentHuggingPriority(.defaultHigh, for: .horizontal)
|
||||||
|
mvmSwitch.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func isValidField() -> Bool {
|
public func isValidField() -> Bool {
|
||||||
Loading…
Reference in New Issue
Block a user