From 5ebc4b0e31119b3e11b75405f97d2bd5754108df Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 24 Jul 2019 15:38:13 -0400 Subject: [PATCH] strikethrough fix warning fix. --- MVMCoreUI/Atoms/Views/Label.swift | 2 +- MVMCoreUI/Molecules/Scroller.swift | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 10b9220e..57a16ad8 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -217,7 +217,7 @@ public typealias ActionBlock = () -> Void case "strikethrough": attributedString.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.thick.rawValue, range: range) - + attributedString.addAttribute(.baselineOffset, value: 0, range: range) case "color": if let colorHex = attribute.optionalStringForKey(KeyTextColor), !colorHex.isEmpty { attributedString.removeAttribute(.foregroundColor, range: range) diff --git a/MVMCoreUI/Molecules/Scroller.swift b/MVMCoreUI/Molecules/Scroller.swift index b76bbb10..cd2949d8 100644 --- a/MVMCoreUI/Molecules/Scroller.swift +++ b/MVMCoreUI/Molecules/Scroller.swift @@ -17,12 +17,14 @@ import UIKit guard scrollView.superview == nil else { return } + translatesAutoresizingMaskIntoConstraints = false + scrollView.translatesAutoresizingMaskIntoConstraints = false addConstrainedView(scrollView) scrollView.addSubview(contentView) - if let constraints = (NSLayoutConstraint.pinView(toSuperview: contentView, useMargins: false) as NSDictionary).allValues as? [NSLayoutConstraint] { - NSLayoutConstraint.activate(constraints) - } - contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, multiplier: 1.0, constant: -0.1).isActive = true + NSLayoutConstraint.constraintPinSubview(toSuperview: contentView) + let constraint = contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, multiplier: 1.0) + constraint.priority = UILayoutPriority(rawValue: 999) + constraint.isActive = true } open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {