From 353f8cd301bd074719ddb8a606c62aefb29d735f Mon Sep 17 00:00:00 2001 From: "Christiano, Kevin" Date: Wed, 19 Jun 2019 16:49:07 -0400 Subject: [PATCH] VCV updated to account for directionalLayoutMargins. LRLabel improved. Needs slight adjustment for iPhone SE. --- MVMCoreUI/Atoms/Views/LeftRightLabelView.swift | 2 +- MVMCoreUI/Atoms/Views/ViewConstrainingView.m | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atoms/Views/LeftRightLabelView.swift b/MVMCoreUI/Atoms/Views/LeftRightLabelView.swift index 81d9f2ff..bb11374e 100644 --- a/MVMCoreUI/Atoms/Views/LeftRightLabelView.swift +++ b/MVMCoreUI/Atoms/Views/LeftRightLabelView.swift @@ -72,7 +72,7 @@ import Foundation // Resolves text layout issues found between both dynamically sized labels, number is not exact but performs as required. if leftTextLabel.hasText && rightTextLabel.hasText { let padding = MFStyler.defaultHorizontalPadding(forSize: size) * 2 - let maximumTextWidth = (size - (padding + 16 + layoutMargins.left + layoutMargins.right)) * 0.4 + let maximumTextWidth = (size - (padding + 16)) * 0.4 rightTextLabel.preferredMaxLayoutWidth = round(maximumTextWidth) } else { rightTextLabel.preferredMaxLayoutWidth = 0 diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m index a7412b93..02d965b7 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m @@ -274,6 +274,11 @@ [super setupView]; self.translatesAutoresizingMaskIntoConstraints = NO; self.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + self.directionalLayoutMargins = NSDirectionalEdgeInsetsZero; + } else { + self.layoutMargins = UIEdgeInsetsZero; + } } - (void)updateView:(CGFloat)size {