mild changes.

This commit is contained in:
Christiano, Kevin 2019-04-01 14:10:47 -04:00
parent 16c644e12d
commit bd69d9fb89

View File

@ -368,7 +368,7 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
var rangeArray = [AnyHashable]() var rangeArray = [AnyHashable]()
for subString in words ?? [] { for subString in words ?? [] {
let finalSubString = subString + (" ") let finalSubString = subString + " "
let wordIndex: Int = index let wordIndex: Int = index
let length: Int = finalSubString.count let length: Int = finalSubString.count
let subStringRange = NSRange(location: wordIndex, length: length) let subStringRange = NSRange(location: wordIndex, length: length)
@ -407,7 +407,7 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
frontText = actionRange.revisedText frontText = actionRange.revisedText
if let revisedText = actionRange.revisedText, let startBraceIndex = actionRange.startIndex, let endBraceIndex = actionRange.endIndex { if let revisedText = actionRange.revisedText, let startBraceIndex = actionRange.startIndex, let endBraceIndex = actionRange.endIndex {
// TODO: Put some of this into a String Extension in MVMCore
frontText = String(revisedText[revisedText.startIndex..<startBraceIndex]).trimmingCharacters(in: .whitespaces) frontText = String(revisedText[revisedText.startIndex..<startBraceIndex]).trimmingCharacters(in: .whitespaces)
actionText = String(revisedText[startBraceIndex..<endBraceIndex]).trimmingCharacters(in: .whitespaces) actionText = String(revisedText[startBraceIndex..<endBraceIndex]).trimmingCharacters(in: .whitespaces)
backText = String(revisedText[endBraceIndex...]).trimmingCharacters(in: .whitespaces) backText = String(revisedText[endBraceIndex...]).trimmingCharacters(in: .whitespaces)
@ -431,7 +431,6 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
fullText = fullText.replacingOccurrences(of: rightBrace, with: "") fullText = fullText.replacingOccurrences(of: rightBrace, with: "")
} }
actionRange.revisedText = fullText actionRange.revisedText = fullText
return actionRange return actionRange
} }
@ -461,7 +460,7 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
// Reset the front text, back text, action map // Reset the front text, back text, action map
@objc public func setFrontAttributedText(_ frontAttributedText: NSAttributedString?, actionMap: [AnyHashable: Any]?, backAttributedText: NSAttributedString?, additionalData: [AnyHashable: Any]?, delegate: ActionObjectDelegate?) { @objc public func setFrontAttributedText(_ frontAttributedText: NSAttributedString?, actionMap: [AnyHashable: Any]?, backAttributedText: NSAttributedString?, additionalData: [AnyHashable: Any]?, delegate: ActionObjectDelegate?) {
setFrontAttributedText(frontAttributedText, actionMap: actionMap, backAttributedText: backAttributedText, addNewLine: false, additionalData: additionalData, delegate: delegate) setFrontAttributedText(frontAttributedText, actionMap: actionMap, backAttributedText: backAttributedText, addNewLine: false, additionalData: additionalData, delegate: delegate)
} }
@ -616,8 +615,6 @@ extension LabelWithInternalButton: MVMCoreUIMoleculeViewProtocol {
self.actionText = actionText self.actionText = actionText
} }
//public var actionBlock: ActionBlock?
// Want this to be last because it has a willSet feature. // Want this to be last because it has a willSet feature.
if let text = dictionary["text"] as? String { if let text = dictionary["text"] as? String {
self.text = text self.text = text