You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FirestoreSwift: Reword DocumentID breaking change in changelog (#10305)
Updated the FirestoreSwift CHANGELOG to match the current state of the repo. Most users will be unaffected since the `@DocumentID` property wrapper constructors remain public but the changelog now warns that the `init(from documentReference: DocumentReference?)` constructor for `DocumentID` is internal.
In greater detail, the following is no longer possible:
```
let userDoc: DocumentReference = Firestore.firestore().document("users/foo")
do {
let docID = try DocumentID<DocumentReference>(from: userDoc)
if let docRef = docID.wrappedValue {
print("Document ID: \(docRef.documentID)")
}
} catch {
print("DocumentID Error: \(error)")
}
```
The visibility change doesn't affect usage of `@DocumentID` though. The following is still possible (though it will trigger our warnings at runtime):
```
struct User: Codable {
@documentid var docRef: DocumentReference? = Firestore.firestore().document("users/foo")
}
```
0 commit comments