Structures
The following structures are available globally.
-
A property wrapper that marks an
Optional<Date>field to be populated with a server timestamp. If aCodableobject being written contains anilfor an@ServerTimestamp-annotated field, it will be replaced withServerValue.timestamp()as it is sent.Example:
struct CustomModel { @ServerTimestamp var ts: Date? }Then writing
CustomModel(ts: nil)will tell server to filltswith current timestamp.Declaration
Swift
@propertyWrapper public struct ServerTimestamp : Codable, Equatable, Hashable