code review - extra spacing

This commit is contained in:
Kyle Matthew Hedden 2020-04-02 17:51:19 -04:00
parent 614a2b89c8
commit 5098bc911b

View File

@ -10,15 +10,15 @@ public extension LabelModel {
convenience init(linkAction: [AnyHashable: Any]) { convenience init(linkAction: [AnyHashable: Any]) {
// Concatentate the text. // Concatentate the text.
let title = linkAction.stringForkey(KeyTitle)
var titlePrefix = linkAction.stringForkey(KeyTitlePrefix) var titlePrefix = linkAction.stringForkey(KeyTitlePrefix)
var titlePostfix = linkAction.stringForkey(KeyTitlePostfix) var titlePostfix = linkAction.stringForkey(KeyTitlePostfix)
if !titlePrefix.isEmpty { if !titlePrefix.isEmpty && (!title.isEmpty || !titlePostfix.isEmpty) {
titlePrefix += " " titlePrefix += " "
} }
if !titlePostfix.isEmpty { if !titlePostfix.isEmpty && !title.isEmpty {
titlePostfix = " " + titlePostfix titlePostfix = " " + titlePostfix
} }
let title = linkAction.optionalStringForKey(KeyTitle) ?? ""
let text = "\(titlePrefix)\(title)\(titlePostfix)" let text = "\(titlePrefix)\(title)\(titlePostfix)"
// Initialize with text. // Initialize with text.