From 7dca635039efb00082624552c223ac7f47ea0cad Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Fri, 20 Apr 2018 14:48:59 -0700 Subject: Move array transforms to internal header pending backend support. (#1139) --- Firestore/Source/API/FIRFieldValue+Internal.h | 28 +++++++++++++++++++++++++++ Firestore/Source/Public/FIRFieldValue.h | 23 ---------------------- 2 files changed, 28 insertions(+), 23 deletions(-) (limited to 'Firestore/Source') diff --git a/Firestore/Source/API/FIRFieldValue+Internal.h b/Firestore/Source/API/FIRFieldValue+Internal.h index 1618cd4..883a307 100644 --- a/Firestore/Source/API/FIRFieldValue+Internal.h +++ b/Firestore/Source/API/FIRFieldValue+Internal.h @@ -54,4 +54,32 @@ NS_ASSUME_NONNULL_BEGIN @property(strong, nonatomic, readonly) NSArray *elements; @end +// TODO(array-features): Move to FIRFieldValue.h once backend support lands. +@interface FIRFieldValue () + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * union the given elements with any array value that already exists on the server. Each + * specified element that doesn't already exist in the array will be added to the end. If the + * field being modified is not already an array it will be overwritten with an array containing + * exactly the specified elements. + * + * @param elements The elements to union into the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayUnion:(NSArray *)elements NS_SWIFT_NAME(arrayUnion(_:)); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * remove the given elements from any array value that already exists on the server. All + * instances of each element specified will be removed from the array. If the field being + * modified is not already an array it will be overwritten with an empty array. + * + * @param elements The elements to remove from the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayRemove:(NSArray *)elements NS_SWIFT_NAME(arrayRemove(_:)); + +@end + NS_ASSUME_NONNULL_END diff --git a/Firestore/Source/Public/FIRFieldValue.h b/Firestore/Source/Public/FIRFieldValue.h index d896587..11a0da0 100644 --- a/Firestore/Source/Public/FIRFieldValue.h +++ b/Firestore/Source/Public/FIRFieldValue.h @@ -38,29 +38,6 @@ NS_SWIFT_NAME(FieldValue) */ + (instancetype)fieldValueForServerTimestamp NS_SWIFT_NAME(serverTimestamp()); -/** - * Returns a special value that can be used with setData() or updateData() that tells the server to - * union the given elements with any array value that already exists on the server. Each - * specified element that doesn't already exist in the array will be added to the end. If the - * field being modified is not already an array it will be overwritten with an array containing - * exactly the specified elements. - * - * @param elements The elements to union into the array. - * @return The FieldValue sentinel for use in a call to setData() or updateData(). - */ -+ (instancetype)fieldValueForArrayUnion:(NSArray *)elements NS_SWIFT_NAME(arrayUnion(_:)); - -/** - * Returns a special value that can be used with setData() or updateData() that tells the server to - * remove the given elements from any array value that already exists on the server. All - * instances of each element specified will be removed from the array. If the field being - * modified is not already an array it will be overwritten with an empty array. - * - * @param elements The elements to remove from the array. - * @return The FieldValue sentinel for use in a call to setData() or updateData(). - */ -+ (instancetype)fieldValueForArrayRemove:(NSArray *)elements NS_SWIFT_NAME(arrayRemove(_:)); - @end NS_ASSUME_NONNULL_END -- cgit v1.2.3