Avatar
omochimetaru 4/26/2018 2:39 AM
@swiftbot import Foundation protocol UserProtocol { static var name: String { get } } extension UserProtocol { static var name: String { return "user" } } struct User: UserProtocol, Codable { var name: String } let u = User(name: "hoge") let a = try! JSONEncoder().encode(u) print(String.init(data: a, encoding: .utf8))
🛠 1