Merge branch 'develop' into feature/kevin
This commit is contained in:
commit
4e6bd61ae6
@ -63,7 +63,8 @@ open class CaretButton: MFCustomButton {
|
|||||||
private func changeCaretColor() {
|
private func changeCaretColor() {
|
||||||
|
|
||||||
if let rightCaretView = rightView as? CaretView {
|
if let rightCaretView = rightView as? CaretView {
|
||||||
rightCaretView.tintColor = isEnabled ? enabledColor : disabledColor
|
let lineColor = isEnabled ? enabledColor : disabledColor
|
||||||
|
rightCaretView.setLineColor(lineColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
import MVMCore
|
import MVMCore
|
||||||
|
|
||||||
public typealias ActionBlock = () -> Void
|
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 ActionObjectDelegate = (NSObjectProtocol & MVMCoreActionDelegateProtocol)
|
||||||
public typealias ButtonObjectDelegate = (NSObjectProtocol & ButtonDelegateProtocol)
|
public typealias ButtonObjectDelegate = (NSObjectProtocol & ButtonDelegateProtocol)
|
||||||
public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProtocol & MVMCoreLoadDelegateProtocol & MVMCorePresentationDelegateProtocol & NSObjectProtocol
|
public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProtocol & MVMCoreLoadDelegateProtocol & MVMCorePresentationDelegateProtocol & NSObjectProtocol
|
||||||
@ -383,22 +383,29 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
|
|||||||
|
|
||||||
let actionableTuple: ActionableStringTuple = rangeOfText(text, startTag: startTag, endTag: endTag)
|
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)
|
frontText = front.trimmingCharacters(in: .whitespaces)
|
||||||
actionText = middle.trimmingCharacters(in: .whitespaces)
|
actionText = middle.trimmingCharacters(in: .whitespaces)
|
||||||
backText = end.trimmingCharacters(in: .whitespaces)
|
backText = end.trimmingCharacters(in: .whitespaces)
|
||||||
self.text = getTextFromStringComponents()
|
|
||||||
} else {
|
} else {
|
||||||
frontText = text
|
frontText = text
|
||||||
self.text = text
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.text = getTextFromStringComponents()
|
||||||
setup()
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
private func rangeOfText(_ text: String?, startTag: String?, endTag: String?) -> ActionableStringTuple {
|
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 }
|
guard let text = text else { return actionableTuple }
|
||||||
|
|
||||||
@ -409,7 +416,7 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
|
|||||||
|
|
||||||
if let rightTag = endTag, text.contains(rightTag) {
|
if let rightTag = endTag, text.contains(rightTag) {
|
||||||
let secondHalf = firstHalf[1].components(separatedBy: rightTag)
|
let secondHalf = firstHalf[1].components(separatedBy: rightTag)
|
||||||
actionableTuple.middle = secondHalf[0]
|
actionableTuple.action = secondHalf[0]
|
||||||
actionableTuple.end = secondHalf[1]
|
actionableTuple.end = secondHalf[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,6 +110,14 @@ import UIKit
|
|||||||
rightPin?.isActive = true
|
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) {
|
open override func setLeftPinConstant(_ constant: CGFloat) {
|
||||||
super.setLeftPinConstant(constant)
|
super.setLeftPinConstant(constant)
|
||||||
alignCenterLeftPin?.constant = constant
|
alignCenterLeftPin?.constant = constant
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user