From bd62fc14ceee087b62eb8307b47bdcf83f18463b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 16 Apr 2019 14:02:20 -0400 Subject: [PATCH 1/3] fill back --- MVMCoreUI/Molecules/ButtonView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MVMCoreUI/Molecules/ButtonView.swift b/MVMCoreUI/Molecules/ButtonView.swift index 8958887c..c23f1aa9 100644 --- a/MVMCoreUI/Molecules/ButtonView.swift +++ b/MVMCoreUI/Molecules/ButtonView.swift @@ -110,6 +110,14 @@ import UIKit rightPin?.isActive = true } + open func alignFill() { + alignCenterPin?.isActive = false + alignCenterLeftPin?.isActive = false + alignCenterRightPin?.isActive = false + leftPin?.isActive = true + rightPin?.isActive = true + } + open override func setLeftPinConstant(_ constant: CGFloat) { super.setLeftPinConstant(constant) alignCenterLeftPin?.constant = constant From 52d909797e7e961b802ea3ec01f3cd07ea976279 Mon Sep 17 00:00:00 2001 From: "Christiano, Kevin" Date: Thu, 18 Apr 2019 16:31:11 -0400 Subject: [PATCH 2/3] adding further checks for safety. --- .../Atoms/Views/LabelWithInternalButton.swift | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift index 60121c3a..08dd9044 100644 --- a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift +++ b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift @@ -10,7 +10,7 @@ import MVMCore public typealias ActionBlock = () -> Void -private typealias ActionableStringTuple = (front: String?, middle: String?, end: String?) +private typealias ActionableStringTuple = (front: String?, action: String?, end: String?) public typealias ActionObjectDelegate = (NSObjectProtocol & MVMCoreActionDelegateProtocol) public typealias ButtonObjectDelegate = (NSObjectProtocol & ButtonDelegateProtocol) public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProtocol & MVMCoreLoadDelegateProtocol & MVMCorePresentationDelegateProtocol & NSObjectProtocol @@ -383,22 +383,29 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt let actionableTuple: ActionableStringTuple = rangeOfText(text, startTag: startTag, endTag: endTag) - if let front = actionableTuple.front, let middle = actionableTuple.middle, let end = actionableTuple.end { + if let text = text, + let leftTag = startTag, + text.contains(leftTag), + let rightTag = endTag, + text.contains(rightTag), + let front = actionableTuple.front, + let middle = actionableTuple.action, + let end = actionableTuple.end { + frontText = front.trimmingCharacters(in: .whitespaces) actionText = middle.trimmingCharacters(in: .whitespaces) backText = end.trimmingCharacters(in: .whitespaces) - self.text = getTextFromStringComponents() } else { frontText = text - self.text = text } + self.text = getTextFromStringComponents() setup() } private func rangeOfText(_ text: String?, startTag: String?, endTag: String?) -> ActionableStringTuple { - var actionableTuple: ActionableStringTuple = (front: nil, middle: nil, end: nil) + var actionableTuple: ActionableStringTuple = (front: nil, action: nil, end: nil) guard let text = text else { return actionableTuple } @@ -409,7 +416,7 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt if let rightTag = endTag, text.contains(rightTag) { let secondHalf = firstHalf[1].components(separatedBy: rightTag) - actionableTuple.middle = secondHalf[0] + actionableTuple.action = secondHalf[0] actionableTuple.end = secondHalf[1] } } From 32bd4c9d078d9c833aa4c3e8e7c870324db1da8c Mon Sep 17 00:00:00 2001 From: panxi Date: Fri, 19 Apr 2019 15:22:54 -0400 Subject: [PATCH 3/3] bugfix for caretbutton --- MVMCoreUI/Atoms/Buttons/CaretButton.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atoms/Buttons/CaretButton.swift b/MVMCoreUI/Atoms/Buttons/CaretButton.swift index 0849ed26..27076a6a 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretButton.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretButton.swift @@ -63,7 +63,8 @@ open class CaretButton: MFCustomButton { private func changeCaretColor() { if let rightCaretView = rightView as? CaretView { - rightCaretView.tintColor = isEnabled ? enabledColor : disabledColor + let lineColor = isEnabled ? enabledColor : disabledColor + rightCaretView.setLineColor(lineColor) } }