From fed9b8ff92187f4c6a5a277c397ae8de25382963 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Wed, 12 Feb 2020 16:45:09 +0530 Subject: [PATCH] added default horizontal padding --- .../LeftRightViews/ListLeftVariableIconWithRightCaret.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift index 7a6ac9be..43a3b5da 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift @@ -29,6 +29,7 @@ import UIKit let spaceBetweenImageAndLeftLabel: CGFloat = 16 let imageSize: CGFloat = 30 let spaceBetweenLabels: CGFloat = 40 + let horizontalPadding = MFStyler.defaultHorizontalPaddingForApplicationWidth() //----------------------------------------------------- // MARK: - View Lifecycle @@ -62,11 +63,12 @@ import UIKit containerView.addSubview(rightLabel) //leftImage constraints - leftImage.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: leftPadding).isActive = true + leftImage.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: horizontalPadding).isActive = true leftImage.centerYAnchor.constraint(equalTo: leftLabel.centerYAnchor).isActive = true leftImage.widthAnchor.constraint(equalToConstant: imageSize).isActive = true leftImage.heightAnchor.constraint(equalToConstant: imageSize).isActive = true + //leftLabel constraints leftLabel.leadingAnchor.constraint(equalTo: leftImage.trailingAnchor, constant: spaceBetweenImageAndLeftLabel).isActive = true leftLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true @@ -76,7 +78,7 @@ import UIKit rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor, constant: spaceBetweenLabels).isActive = true rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true rightLabel.bottomAnchor.constraint(equalTo: containerView.bottomAnchor).isActive = true - containerView.trailingAnchor.constraint(equalTo: rightLabel.trailingAnchor,constant: PaddingNine).isActive = true + rightLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor,constant: -horizontalPadding - 20).isActive = true } //----------------------------------------------------