Replace TableCell struct with AdditionField

This commit is contained in:
Danny Moesch 2018-12-15 21:48:35 +01:00 committed by Bob Sun
parent ed387069a4
commit 9e027b878a
4 changed files with 29 additions and 50 deletions

View file

@ -10,6 +10,11 @@ public struct AdditionField: Hashable {
public let title: String, content: String
public init(title: String = "", content: String = "") {
self.title = title
self.content = content
}
var asString: String {
return title.isEmpty ? content : title + ": " + content
}
@ -42,6 +47,6 @@ extension AdditionField: Equatable {
}
infix operator =>: MultiplicationPrecedence
func => (key: String, value: String) -> AdditionField {
public func => (key: String, value: String) -> AdditionField {
return AdditionField(title: key, content: value)
}