aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Public/FIRDocumentReference.h
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-04-14 17:19:06 -0700
committerGravatar GitHub <noreply@github.com>2018-04-14 17:19:06 -0700
commit33b12f6c70729d56c6e6350d435559cec1c44c61 (patch)
tree60d916bb7509f82e8950b887b45f9dd0bf80251a /Firestore/Source/Public/FIRDocumentReference.h
parentfd84cd60aaf52cbe405ff8248665029827d56e97 (diff)
Replace `DocumentListenOptions` with a simple boolean. (#1099)
* Replace `DocumentListenOptions` with a simple boolean. Instead of calling `addSnapshotListener(options: DocumentListenOptions.includeMetadataChanges(true))` call `addSnapshotListener(includeMetadataChanges:true)` * Style
Diffstat (limited to 'Firestore/Source/Public/FIRDocumentReference.h')
-rw-r--r--Firestore/Source/Public/FIRDocumentReference.h34
1 files changed, 6 insertions, 28 deletions
diff --git a/Firestore/Source/Public/FIRDocumentReference.h b/Firestore/Source/Public/FIRDocumentReference.h
index 7fcc7a8..dd2d106 100644
--- a/Firestore/Source/Public/FIRDocumentReference.h
+++ b/Firestore/Source/Public/FIRDocumentReference.h
@@ -25,29 +25,6 @@
NS_ASSUME_NONNULL_BEGIN
-/**
- * Options for use with `[FIRDocumentReference addSnapshotListener]` to control the behavior of the
- * snapshot listener.
- */
-NS_SWIFT_NAME(DocumentListenOptions)
-@interface FIRDocumentListenOptions : NSObject
-
-+ (instancetype)options NS_SWIFT_UNAVAILABLE("Use initializer");
-
-- (instancetype)init;
-
-/**
- * Sets the includeMetadataChanges option which controls whether metadata-only changes (i.e. only
- * `FIRDocumentSnapshot.metadata` changed) should trigger snapshot events. Default is NO.
- *
- * @param includeMetadataChanges Whether to raise events for metadata-only changes.
- * @return The receiver is returned for optional method chaining.
- */
-- (instancetype)includeMetadataChanges:(BOOL)includeMetadataChanges
- NS_SWIFT_NAME(includeMetadataChanges(_:));
-
-@end
-
typedef void (^FIRDocumentSnapshotBlock)(FIRDocumentSnapshot *_Nullable snapshot,
NSError *_Nullable error);
@@ -208,16 +185,17 @@ NS_SWIFT_NAME(DocumentReference)
/**
* Attaches a listener for DocumentSnapshot events.
*
- * @param options Options controlling the listener behavior.
+ * @param includeMetadataChanges Whether metadata-only changes (i.e. only
+ * `FIRDocumentSnapshot.metadata` changed) should trigger snapshot events.
* @param listener The listener to attach.
*
* @return A FIRListenerRegistration that can be used to remove this listener.
*/
// clang-format off
-- (id<FIRListenerRegistration>)addSnapshotListenerWithOptions:
- (nullable FIRDocumentListenOptions *)options
- listener:(FIRDocumentSnapshotBlock)listener
- NS_SWIFT_NAME(addSnapshotListener(options:listener:));
+- (id<FIRListenerRegistration>)
+addSnapshotListenerWithIncludeMetadataChanges:(BOOL)includeMetadataChanges
+ listener:(FIRDocumentSnapshotBlock)listener
+ NS_SWIFT_NAME(addSnapshotListener(includeMetadataChanges:listener:));
// clang-format on
@end