我定义了很多结构。
现在,我正在实施许多description
方法。
你知道更简单的方法吗?
public struct Button: Codable, Dictionable {
public var type: String?
public var title: String?
public var value: String?
}
extension Button: CustomStringConvertible, CustomDebugStringConvertible {
public var description: String {
return "type: \(type ?? ""), title: \(title ?? ""), value: \(value ?? "")"
}
public var debugDescription: String {
return description
}
}