有没有办法创建自定义Swift对象,将Firebase文档ID分配给对象参数?代码摘自此处:https://firebase.google.com/docs/firestore/query-data/get-data#custom_objects public struct City: Codable { let nam
我有以下结构 @DocumentID var id: String?var name: String只要我使用默认的Swift解码器,我就可以毫无问题地加载Firestore条目(使用document.data(as: ),并且id包含文档ID。decoder.container(keyedBy: CodingKeys.self) if let id = try container.decodeIfPre