forked from compnerd/swift-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CollectionReference implement Query (#32)
Given that C++ types are exposed as structs and structs do not support inheritance in Swift, the fact that the C++ `CollectionReference` inherits from `Query` is not exposed on the Swift side. We then workaround that by defining a protocol that both `Query` and `CollectionReference` can conform to. Also expose `CollectionReference.path()` and `FieldValue.serverTimestamp()`.
- Loading branch information
Showing
5 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
@_exported | ||
import firebase | ||
|
||
public typealias FieldValue = firebase.firestore.FieldValue | ||
|
||
extension FieldValue { | ||
public static func serverTimestamp() { | ||
ServerTimestamp() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters