Search
Search
Search
struct GusetComment: Codable, Equatable {
static func == (lhs: GusetComment, rhs: GusetComment) -> Bool {
return lhs.id == rhs.id
}
var id: Int
var content: String
var isLike: Bool
var nickname: String
enum CodingKeys: String, CodingKey {
case id
case content
case isLike
case nickname
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
id = try values.decode(Int.self, forKey: .id)
content = try values.decode(String.self, forKey: .content)
isLike = try values.decode(Bool.self, forKey: .isLike)
nickname = try values.decode(String.self, forKey: .nickname)
}
}
Swift
복사
if $vm.showText.wrappedValue {
Text("⚠️현재 위치에서는 방명록을 남길 수 없습니다!")
.padding(EdgeInsets(top: 11, leading: 16, bottom: 12, trailing: 16))
.background(RoundedRectangle(cornerRadius: 12).foregroundColor(.black))
.foregroundColor(Color.red)
}
Swift
복사