From 5098bc911bda89e417c9f3fd0b7e2c7dfec719d9 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Thu, 2 Apr 2020 17:51:19 -0400 Subject: [PATCH] code review - extra spacing --- MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift index 396de6ea..6b94f63e 100644 --- a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift @@ -10,15 +10,15 @@ public extension LabelModel { convenience init(linkAction: [AnyHashable: Any]) { // Concatentate the text. + let title = linkAction.stringForkey(KeyTitle) var titlePrefix = linkAction.stringForkey(KeyTitlePrefix) var titlePostfix = linkAction.stringForkey(KeyTitlePostfix) - if !titlePrefix.isEmpty { + if !titlePrefix.isEmpty && (!title.isEmpty || !titlePostfix.isEmpty) { titlePrefix += " " } - if !titlePostfix.isEmpty { + if !titlePostfix.isEmpty && !title.isEmpty { titlePostfix = " " + titlePostfix } - let title = linkAction.optionalStringForKey(KeyTitle) ?? "" let text = "\(titlePrefix)\(title)\(titlePostfix)" // Initialize with text.