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
Currently, when adding an Encodable document to a collection, the addDocument method returns a DocumentReference. Often this is not need and thus generates a warning in Xcode which can be silenced by
let _ =tryFirestore.firestore().collection("collectionName").addDocument(from: encodable)
To improve developer experience I suggest to add the @discardableResult attribute to the addDocument method which will tell the Swift compiler that it is okay for the return value to be unused.
Description
Currently, when adding an Encodable document to a collection, the
addDocument
method returns aDocumentReference
. Often this is not need and thus generates a warning in Xcode which can be silenced byTo improve developer experience I suggest to add the
@discardableResult
attribute to the addDocument method which will tell the Swift compiler that it is okay for the return value to be unused.See required changes here: Eskils@c44c187
API Proposal
No response
Firebase Product(s)
Firestore
The text was updated successfully, but these errors were encountered: