diff options
author | Ryan Wilson <wilsonryan@google.com> | 2017-11-28 06:59:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 06:59:07 -0800 |
commit | 7386f00178be4fe1f8d8f749049d25cbf0533e6a (patch) | |
tree | 02ba61c9cda5c439b4b991c7286f93ea8512bbea /Firestore | |
parent | 7459be46ffb27bc95e155a1b267f91093f1a62b0 (diff) |
Replacing FIR_SWIFT_NAME macro with NS_SWIFT_NAME. (#476)
* Replacing FIR_SWIFT_NAME macro with NS_SWIFT_NAME.
This pushes the minimum Xcode version to 7.3, as NS_SWIFT_NAME was
limited before that version (which is why the macro was introduced in
the first place).
* Fixed FIRMessaging header
Diffstat (limited to 'Firestore')
19 files changed, 78 insertions, 139 deletions
diff --git a/Firestore/Source/API/FIRFirestore+Internal.h b/Firestore/Source/API/FIRFirestore+Internal.h index 08f5266..c2e995a 100644 --- a/Firestore/Source/API/FIRFirestore+Internal.h +++ b/Firestore/Source/API/FIRFirestore+Internal.h @@ -15,7 +15,6 @@ */ #import "FIRFirestore.h" -#import "FIRFirestoreSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -53,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN * @param completion A block to execute once everything has shut down. */ - (void)shutdownWithCompletion:(nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(shutdown(completion:)); + NS_SWIFT_NAME(shutdown(completion:)); @property(nonatomic, strong, readonly) FSTDatabaseID *databaseID; @property(nonatomic, strong, readonly) FSTFirestoreClient *client; diff --git a/Firestore/Source/Public/FIRCollectionReference.h b/Firestore/Source/Public/FIRCollectionReference.h index 11cb969..ba3389f 100644 --- a/Firestore/Source/Public/FIRCollectionReference.h +++ b/Firestore/Source/Public/FIRCollectionReference.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRQuery.h" NS_ASSUME_NONNULL_BEGIN @@ -27,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * A `FIRCollectionReference` object can be used for adding documents, getting document references, * and querying for documents (using the methods inherited from `FIRQuery`). */ -FIR_SWIFT_NAME(CollectionReference) +NS_SWIFT_NAME(CollectionReference) @interface FIRCollectionReference : FIRQuery /** */ @@ -53,7 +52,7 @@ FIR_SWIFT_NAME(CollectionReference) * * @return A FIRDocumentReference pointing to a new document with an auto-generated ID. */ -- (FIRDocumentReference *)documentWithAutoID FIR_SWIFT_NAME(document()); +- (FIRDocumentReference *)documentWithAutoID NS_SWIFT_NAME(document()); /** * Gets a `FIRDocumentReference` referring to the document at the specified path, relative to this @@ -64,7 +63,7 @@ FIR_SWIFT_NAME(CollectionReference) * * @return The `FIRDocumentReference` for the specified document path. */ -- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath FIR_SWIFT_NAME(document(_:)); +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); /** * Add a new document to this collection with the specified data, assigning it a document ID @@ -75,7 +74,7 @@ FIR_SWIFT_NAME(CollectionReference) * @return A `FIRDocumentReference` pointing to the newly created document. */ - (FIRDocumentReference *)addDocumentWithData:(NSDictionary<NSString *, id> *)data - FIR_SWIFT_NAME(addDocument(data:)); + NS_SWIFT_NAME(addDocument(data:)); /** * Add a new document to this collection with the specified data, assigning it a document ID @@ -87,11 +86,11 @@ FIR_SWIFT_NAME(CollectionReference) * @return A `FIRDocumentReference` pointing to the newly created document. */ // clang-format off -// clang-format breaks the FIR_SWIFT_NAME attribute +// clang-format breaks the NS_SWIFT_NAME attribute - (FIRDocumentReference *)addDocumentWithData:(NSDictionary<NSString *, id> *)data completion: (nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(addDocument(data:completion:)); + NS_SWIFT_NAME(addDocument(data:completion:)); // clang-format on @end diff --git a/Firestore/Source/Public/FIRDocumentChange.h b/Firestore/Source/Public/FIRDocumentChange.h index 674e3b2..022c81b 100644 --- a/Firestore/Source/Public/FIRDocumentChange.h +++ b/Firestore/Source/Public/FIRDocumentChange.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentSnapshot; @@ -33,13 +31,13 @@ typedef NS_ENUM(NSInteger, FIRDocumentChangeType) { * the query. */ FIRDocumentChangeTypeRemoved -} FIR_SWIFT_NAME(DocumentChangeType); +} NS_SWIFT_NAME(DocumentChangeType); /** * A `FIRDocumentChange` represents a change to the documents matching a query. It contains the * document affected and the type of change that occurred (added, modified, or removed). */ -FIR_SWIFT_NAME(DocumentChange) +NS_SWIFT_NAME(DocumentChange) @interface FIRDocumentChange : NSObject /** */ diff --git a/Firestore/Source/Public/FIRDocumentReference.h b/Firestore/Source/Public/FIRDocumentReference.h index 03340c1..bd6d7b8 100644 --- a/Firestore/Source/Public/FIRDocumentReference.h +++ b/Firestore/Source/Public/FIRDocumentReference.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRListenerRegistration.h" @class FIRFirestore; @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * Options for use with `[FIRDocumentReference addSnapshotListener]` to control the behavior of the * snapshot listener. */ -FIR_SWIFT_NAME(DocumentListenOptions) +NS_SWIFT_NAME(DocumentListenOptions) @interface FIRDocumentListenOptions : NSObject + (instancetype)options NS_SWIFT_UNAVAILABLE("Use initializer"); @@ -47,7 +46,7 @@ FIR_SWIFT_NAME(DocumentListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeMetadataChanges:(BOOL)includeMetadataChanges - FIR_SWIFT_NAME(includeMetadataChanges(_:)); + NS_SWIFT_NAME(includeMetadataChanges(_:)); @end @@ -60,7 +59,7 @@ typedef void (^FIRDocumentSnapshotBlock)(FIRDocumentSnapshot *_Nullable snapshot * may or may not exist. A `FIRDocumentReference` can also be used to create a * `FIRCollectionReference` to a subcollection. */ -FIR_SWIFT_NAME(DocumentReference) +NS_SWIFT_NAME(DocumentReference) @interface FIRDocumentReference : NSObject /** */ @@ -92,7 +91,7 @@ FIR_SWIFT_NAME(DocumentReference) * @return The `FIRCollectionReference` at the specified _collectionPath_. */ - (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath - FIR_SWIFT_NAME(collection(_:)); + NS_SWIFT_NAME(collection(_:)); #pragma mark - Writing Data @@ -166,7 +165,7 @@ FIR_SWIFT_NAME(DocumentReference) // NOTE: this is named 'deleteDocument' because 'delete' is a keyword in Objective-C++. /** Deletes the document referred to by this `FIRDocumentReference`. */ // clang-format off -- (void)deleteDocument FIR_SWIFT_NAME(delete()); +- (void)deleteDocument NS_SWIFT_NAME(delete()); // clang-format on /** @@ -176,7 +175,7 @@ FIR_SWIFT_NAME(DocumentReference) */ // clang-format off - (void)deleteDocumentWithCompletion:(nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(delete(completion:)); + NS_SWIFT_NAME(delete(completion:)); // clang-format on #pragma mark - Retrieving Data @@ -187,7 +186,7 @@ FIR_SWIFT_NAME(DocumentReference) * @param completion a block to execute once the document has been successfully read. */ - (void)getDocumentWithCompletion:(FIRDocumentSnapshotBlock)completion - FIR_SWIFT_NAME(getDocument(completion:)); + NS_SWIFT_NAME(getDocument(completion:)); /** * Attaches a listener for DocumentSnapshot events. @@ -197,7 +196,7 @@ FIR_SWIFT_NAME(DocumentReference) * @return A FIRListenerRegistration that can be used to remove this listener. */ - (id<FIRListenerRegistration>)addSnapshotListener:(FIRDocumentSnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(_:)); + NS_SWIFT_NAME(addSnapshotListener(_:)); /** * Attaches a listener for DocumentSnapshot events. @@ -211,7 +210,7 @@ FIR_SWIFT_NAME(DocumentReference) - (id<FIRListenerRegistration>)addSnapshotListenerWithOptions: (nullable FIRDocumentListenOptions *)options listener:(FIRDocumentSnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(options:listener:)); + NS_SWIFT_NAME(addSnapshotListener(options:listener:)); // clang-format on @end diff --git a/Firestore/Source/Public/FIRDocumentSnapshot.h b/Firestore/Source/Public/FIRDocumentSnapshot.h index e923e3e..3e67c25 100644 --- a/Firestore/Source/Public/FIRDocumentSnapshot.h +++ b/Firestore/Source/Public/FIRDocumentSnapshot.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - @class FIRDocumentReference; @class FIRSnapshotMetadata; @@ -28,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * can be extracted with the `data` property or by using subscript syntax to access a specific * field. */ -FIR_SWIFT_NAME(DocumentSnapshot) +NS_SWIFT_NAME(DocumentSnapshot) @interface FIRDocumentSnapshot : NSObject /** */ diff --git a/Firestore/Source/Public/FIRFieldPath.h b/Firestore/Source/Public/FIRFieldPath.h index b80eda7..3445f2e 100644 --- a/Firestore/Source/Public/FIRFieldPath.h +++ b/Firestore/Source/Public/FIRFieldPath.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN * (referring to a top level field in the document), or a list of field names (referring to a nested * field in the document). */ -FIR_SWIFT_NAME(FieldPath) +NS_SWIFT_NAME(FieldPath) @interface FIRFieldPath : NSObject <NSCopying> - (instancetype)init NS_UNAVAILABLE; @@ -37,7 +35,7 @@ FIR_SWIFT_NAME(FieldPath) * @param fieldNames A list of field names. * @return A `FieldPath` that points to a field location in a document. */ -- (instancetype)initWithFields:(NSArray<NSString *> *)fieldNames FIR_SWIFT_NAME(init(_:)); +- (instancetype)initWithFields:(NSArray<NSString *> *)fieldNames NS_SWIFT_NAME(init(_:)); /** * A special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to diff --git a/Firestore/Source/Public/FIRFieldValue.h b/Firestore/Source/Public/FIRFieldValue.h index f7d19f0..11a0da0 100644 --- a/Firestore/Source/Public/FIRFieldValue.h +++ b/Firestore/Source/Public/FIRFieldValue.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** * Sentinel values that can be used when writing document fields with setData() or updateData(). */ -FIR_SWIFT_NAME(FieldValue) +NS_SWIFT_NAME(FieldValue) @interface FIRFieldValue : NSObject /** */ @@ -31,14 +29,14 @@ FIR_SWIFT_NAME(FieldValue) /** Used with updateData() to mark a field for deletion. */ // clang-format off -+ (instancetype)fieldValueForDelete FIR_SWIFT_NAME(delete()); ++ (instancetype)fieldValueForDelete NS_SWIFT_NAME(delete()); // clang-format on /** * Used with setData() or updateData() to include a server-generated timestamp in the written * data. */ -+ (instancetype)fieldValueForServerTimestamp FIR_SWIFT_NAME(serverTimestamp()); ++ (instancetype)fieldValueForServerTimestamp NS_SWIFT_NAME(serverTimestamp()); @end diff --git a/Firestore/Source/Public/FIRFirestore.h b/Firestore/Source/Public/FIRFirestore.h index c31fef6..0935917 100644 --- a/Firestore/Source/Public/FIRFirestore.h +++ b/Firestore/Source/Public/FIRFirestore.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - @class FIRApp; @class FIRCollectionReference; @class FIRDocumentReference; @@ -31,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * `FIRFirestore` represents a Firestore Database and is the entry point for all Firestore * operations. */ -FIR_SWIFT_NAME(Firestore) +NS_SWIFT_NAME(Firestore) @interface FIRFirestore : NSObject #pragma mark - Initializing @@ -44,7 +42,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRFirestore` instance. */ -+ (instancetype)firestore FIR_SWIFT_NAME(firestore()); ++ (instancetype)firestore NS_SWIFT_NAME(firestore()); /** * Creates, caches, and returns a `FIRFirestore` object for the specified _app_. Each subsequent @@ -56,7 +54,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRFirestore` instance. */ -+ (instancetype)firestoreForApp:(FIRApp *)app FIR_SWIFT_NAME(firestore(app:)); ++ (instancetype)firestoreForApp:(FIRApp *)app NS_SWIFT_NAME(firestore(app:)); /** * Custom settings used to configure this `FIRFirestore` object. @@ -80,7 +78,7 @@ FIR_SWIFT_NAME(Firestore) * @return The `FIRCollectionReference` at the specified _collectionPath_. */ - (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath - FIR_SWIFT_NAME(collection(_:)); + NS_SWIFT_NAME(collection(_:)); /** * Gets a `FIRDocumentReference` referring to the document at the specified path within the @@ -91,7 +89,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRDocumentReference` for the specified _documentPath_. */ -- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath FIR_SWIFT_NAME(document(_:)); +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); #pragma mark - Transactions and Write Batches diff --git a/Firestore/Source/Public/FIRFirestoreErrors.h b/Firestore/Source/Public/FIRFirestoreErrors.h index f2e19d9..968391c 100644 --- a/Firestore/Source/Public/FIRFirestoreErrors.h +++ b/Firestore/Source/Public/FIRFirestoreErrors.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** The Cloud Firestore error domain. */ -FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain FIR_SWIFT_NAME(FirestoreErrorDomain); +FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain NS_SWIFT_NAME(FirestoreErrorDomain); /** Error codes used by Cloud Firestore. */ typedef NS_ENUM(NSInteger, FIRFirestoreErrorCode) { @@ -100,6 +98,6 @@ typedef NS_ENUM(NSInteger, FIRFirestoreErrorCode) { /** The request does not have valid authentication credentials for the operation. */ FIRFirestoreErrorCodeUnauthenticated = 16 -} FIR_SWIFT_NAME(FirestoreErrorCode); +} NS_SWIFT_NAME(FirestoreErrorCode); NS_ASSUME_NONNULL_END diff --git a/Firestore/Source/Public/FIRFirestoreSettings.h b/Firestore/Source/Public/FIRFirestoreSettings.h index 7097e60..7a1f2a3 100644 --- a/Firestore/Source/Public/FIRFirestoreSettings.h +++ b/Firestore/Source/Public/FIRFirestoreSettings.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Settings used to configure a `FIRFirestore` instance. */ -FIR_SWIFT_NAME(FirestoreSettings) +NS_SWIFT_NAME(FirestoreSettings) @interface FIRFirestoreSettings : NSObject <NSCopying> /** diff --git a/Firestore/Source/Public/FIRFirestoreSwiftNameSupport.h b/Firestore/Source/Public/FIRFirestoreSwiftNameSupport.h deleted file mode 100644 index 216c047..0000000 --- a/Firestore/Source/Public/FIRFirestoreSwiftNameSupport.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIR_SWIFT_NAME - -#import <Foundation/Foundation.h> - -// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. -// Wrap it in our own macro if it's a non-compatible SDK. -#ifdef __IPHONE_9_3 -#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) -#else -#define FIR_SWIFT_NAME(X) // Intentionally blank. -#endif // #ifdef __IPHONE_9_3 - -#endif // FIR_SWIFT_NAME diff --git a/Firestore/Source/Public/FIRGeoPoint.h b/Firestore/Source/Public/FIRGeoPoint.h index de409b5..ee7a7ea 100644 --- a/Firestore/Source/Public/FIRGeoPoint.h +++ b/Firestore/Source/Public/FIRGeoPoint.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -27,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN * Latitude values are in the range of [-90, 90]. * Longitude values are in the range of [-180, 180]. */ -FIR_SWIFT_NAME(GeoPoint) +NS_SWIFT_NAME(GeoPoint) @interface FIRGeoPoint : NSObject <NSCopying> /** */ diff --git a/Firestore/Source/Public/FIRListenerRegistration.h b/Firestore/Source/Public/FIRListenerRegistration.h index 93df407..c3a16cd 100644 --- a/Firestore/Source/Public/FIRListenerRegistration.h +++ b/Firestore/Source/Public/FIRListenerRegistration.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Represents a listener that can be removed by calling remove. */ -FIR_SWIFT_NAME(ListenerRegistration) +NS_SWIFT_NAME(ListenerRegistration) @protocol FIRListenerRegistration <NSObject> /** diff --git a/Firestore/Source/Public/FIRQuery.h b/Firestore/Source/Public/FIRQuery.h index 5c5546d..4e7e161 100644 --- a/Firestore/Source/Public/FIRQuery.h +++ b/Firestore/Source/Public/FIRQuery.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRListenerRegistration.h" @class FIRFieldPath; @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * Options for use with `[FIRQuery addSnapshotListener]` to control the behavior of the snapshot * listener. */ -FIR_SWIFT_NAME(QueryListenOptions) +NS_SWIFT_NAME(QueryListenOptions) @interface FIRQueryListenOptions : NSObject + (instancetype)options NS_SWIFT_UNAVAILABLE("Use initializer"); @@ -49,7 +48,7 @@ FIR_SWIFT_NAME(QueryListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeQueryMetadataChanges:(BOOL)includeQueryMetadataChanges - FIR_SWIFT_NAME(includeQueryMetadataChanges(_:)); + NS_SWIFT_NAME(includeQueryMetadataChanges(_:)); @property(nonatomic, assign, readonly) BOOL includeDocumentMetadataChanges; @@ -62,7 +61,7 @@ FIR_SWIFT_NAME(QueryListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeDocumentMetadataChanges:(BOOL)includeDocumentMetadataChanges - FIR_SWIFT_NAME(includeDocumentMetadataChanges(_:)); + NS_SWIFT_NAME(includeDocumentMetadataChanges(_:)); @end @@ -73,7 +72,7 @@ typedef void (^FIRQuerySnapshotBlock)(FIRQuerySnapshot *_Nullable snapshot, * A `FIRQuery` refers to a Query which you can read or listen to. You can also construct * refined `FIRQuery` objects by adding filters and ordering. */ -FIR_SWIFT_NAME(Query) +NS_SWIFT_NAME(Query) @interface FIRQuery : NSObject /** */ - (id)init __attribute__((unavailable("FIRQuery cannot be created directly."))); @@ -89,7 +88,7 @@ FIR_SWIFT_NAME(Query) * documentSet will be `nil` only if error is `non-nil`. */ - (void)getDocumentsWithCompletion:(FIRQuerySnapshotBlock)completion - FIR_SWIFT_NAME(getDocuments(completion:)); + NS_SWIFT_NAME(getDocuments(completion:)); /** * Attaches a listener for QuerySnapshot events. @@ -99,7 +98,7 @@ FIR_SWIFT_NAME(Query) * @return A FIRListenerRegistration that can be used to remove this listener. */ - (id<FIRListenerRegistration>)addSnapshotListener:(FIRQuerySnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(_:)); + NS_SWIFT_NAME(addSnapshotListener(_:)); /** * Attaches a listener for QuerySnapshot events. @@ -113,7 +112,7 @@ FIR_SWIFT_NAME(Query) - (id<FIRListenerRegistration>)addSnapshotListenerWithOptions: (nullable FIRQueryListenOptions *)options listener:(FIRQuerySnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(options:listener:)); + NS_SWIFT_NAME(addSnapshotListener(options:listener:)); // clang-format on #pragma mark - Filtering Data @@ -128,7 +127,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isEqualTo:)); + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); // clang-format on /** @@ -142,7 +141,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isEqualTo:)); + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); // clang-format on /** @@ -156,7 +155,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isLessThan:(id)value FIR_SWIFT_NAME(whereField(_:isLessThan:)); + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); // clang-format on /** @@ -170,7 +169,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThan:(id)value FIR_SWIFT_NAME(whereField(_:isLessThan:)); + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); // clang-format on /** @@ -184,7 +183,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isLessThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); // clang-format on /** @@ -198,7 +197,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); // clang-format on /** @@ -212,7 +211,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThan:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThan:)); + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); // clang-format on /** @@ -226,7 +225,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThan:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThan:)); + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); // clang-format on /** @@ -240,7 +239,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); // clang-format on /** @@ -254,7 +253,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); // clang-format on #pragma mark - Sorting Data @@ -265,7 +264,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryOrderedByField:(NSString *)field FIR_SWIFT_NAME(order(by:)); +- (FIRQuery *)queryOrderedByField:(NSString *)field NS_SWIFT_NAME(order(by:)); /** * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. @@ -274,7 +273,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path FIR_SWIFT_NAME(order(by:)); +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path NS_SWIFT_NAME(order(by:)); /** * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, @@ -287,7 +286,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryOrderedByField:(NSString *)field - descending:(BOOL)descending FIR_SWIFT_NAME(order(by:descending:)); + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); // clang-format on /** @@ -301,7 +300,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path - descending:(BOOL)descending FIR_SWIFT_NAME(order(by:descending:)); + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); // clang-format on #pragma mark - Limiting Data @@ -313,7 +312,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryLimitedTo:(NSInteger)limit FIR_SWIFT_NAME(limit(to:)); +- (FIRQuery *)queryLimitedTo:(NSInteger)limit NS_SWIFT_NAME(limit(to:)); #pragma mark - Choosing Endpoints /** @@ -326,7 +325,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(start(atDocument:)); + NS_SWIFT_NAME(start(atDocument:)); /** * Creates and returns a new `FIRQuery` that starts at the provided fields relative to the order of @@ -337,7 +336,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues FIR_SWIFT_NAME(start(at:)); +- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(at:)); /** * Creates and returns a new `FIRQuery` that starts after the provided document (exclusive). The @@ -349,7 +348,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryStartingAfterDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(start(afterDocument:)); + NS_SWIFT_NAME(start(afterDocument:)); /** * Creates and returns a new `FIRQuery` that starts after the provided fields relative to the order @@ -361,7 +360,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues FIR_SWIFT_NAME(start(after:)); +- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(after:)); /** * Creates and returns a new `FIRQuery` that ends before the provided document (exclusive). The end @@ -373,7 +372,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryEndingBeforeDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(end(beforeDocument:)); + NS_SWIFT_NAME(end(beforeDocument:)); /** * Creates and returns a new `FIRQuery` that ends before the provided fields relative to the order @@ -384,7 +383,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues FIR_SWIFT_NAME(end(before:)); +- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(before:)); /** * Creates and returns a new `FIRQuery` that ends at the provided document (exclusive). The end @@ -396,7 +395,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(end(atDocument:)); + NS_SWIFT_NAME(end(atDocument:)); /** * Creates and returns a new `FIRQuery` that ends at the provided fields relative to the order of @@ -407,7 +406,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues FIR_SWIFT_NAME(end(at:)); +- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(at:)); @end diff --git a/Firestore/Source/Public/FIRQuerySnapshot.h b/Firestore/Source/Public/FIRQuerySnapshot.h index 800368d..c49a07a 100644 --- a/Firestore/Source/Public/FIRQuerySnapshot.h +++ b/Firestore/Source/Public/FIRQuerySnapshot.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentChange; @@ -30,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN * using "for ... in documentSet.documents" and its size can be inspected with `isEmpty` and * `count`. */ -FIR_SWIFT_NAME(QuerySnapshot) +NS_SWIFT_NAME(QuerySnapshot) @interface FIRQuerySnapshot : NSObject /** */ diff --git a/Firestore/Source/Public/FIRSetOptions.h b/Firestore/Source/Public/FIRSetOptions.h index e1103a1..c865e06 100644 --- a/Firestore/Source/Public/FIRSetOptions.h +++ b/Firestore/Source/Public/FIRSetOptions.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -26,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN * `FIRWriteBatch` and `FIRTransaction` can be configured to perform granular merges instead * of overwriting the target documents in their entirety. */ -FIR_SWIFT_NAME(SetOptions) +NS_SWIFT_NAME(SetOptions) @interface FIRSetOptions : NSObject /** */ diff --git a/Firestore/Source/Public/FIRSnapshotMetadata.h b/Firestore/Source/Public/FIRSnapshotMetadata.h index 04a6b45..4c7ff98 100644 --- a/Firestore/Source/Public/FIRSnapshotMetadata.h +++ b/Firestore/Source/Public/FIRSnapshotMetadata.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Metadata about a snapshot, describing the state of the snapshot. */ -FIR_SWIFT_NAME(SnapshotMetadata) +NS_SWIFT_NAME(SnapshotMetadata) @interface FIRSnapshotMetadata : NSObject - (instancetype)init NS_UNAVAILABLE; diff --git a/Firestore/Source/Public/FIRTransaction.h b/Firestore/Source/Public/FIRTransaction.h index 68e4600..51a6e90 100644 --- a/Firestore/Source/Public/FIRTransaction.h +++ b/Firestore/Source/Public/FIRTransaction.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentReference; @@ -29,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * * @see FIRFirestore#transaction:completion: */ -FIR_SWIFT_NAME(Transaction) +NS_SWIFT_NAME(Transaction) @interface FIRTransaction : NSObject /** */ @@ -47,7 +45,7 @@ FIR_SWIFT_NAME(Transaction) // clang-format off - (FIRTransaction *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(setData(_:forDocument:)); + NS_SWIFT_NAME(setData(_:forDocument:)); // clang-format on /** @@ -64,7 +62,7 @@ FIR_SWIFT_NAME(Transaction) - (FIRTransaction *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document options:(FIRSetOptions *)options - FIR_SWIFT_NAME(setData(_:forDocument:options:)); + NS_SWIFT_NAME(setData(_:forDocument:options:)); // clang-format on /** @@ -79,7 +77,7 @@ FIR_SWIFT_NAME(Transaction) // clang-format off - (FIRTransaction *)updateData:(NSDictionary<id, id> *)fields forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(updateData(_:forDocument:)); + NS_SWIFT_NAME(updateData(_:forDocument:)); // clang-format on /** @@ -89,7 +87,7 @@ FIR_SWIFT_NAME(Transaction) * @return This `FIRTransaction` instance. Used for chaining method calls. */ - (FIRTransaction *)deleteDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(deleteDocument(_:)); + NS_SWIFT_NAME(deleteDocument(_:)); /** * Reads the document referenced by `document`. @@ -99,7 +97,7 @@ FIR_SWIFT_NAME(Transaction) */ - (FIRDocumentSnapshot *_Nullable)getDocument:(FIRDocumentReference *)document error:(NSError *__autoreleasing *)error - FIR_SWIFT_NAME(getDocument(_:)); + NS_SWIFT_NAME(getDocument(_:)); @end diff --git a/Firestore/Source/Public/FIRWriteBatch.h b/Firestore/Source/Public/FIRWriteBatch.h index b88e6cc..a74d451 100644 --- a/Firestore/Source/Public/FIRWriteBatch.h +++ b/Firestore/Source/Public/FIRWriteBatch.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentReference; @@ -33,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN * Unlike transactions, write batches are persisted offline and therefore are preferable when you * don't need to condition your writes on read data. */ -FIR_SWIFT_NAME(WriteBatch) +NS_SWIFT_NAME(WriteBatch) @interface FIRWriteBatch : NSObject /** :nodoc: */ @@ -50,7 +48,7 @@ FIR_SWIFT_NAME(WriteBatch) */ // clang-format off - (FIRWriteBatch *)setData:(NSDictionary<NSString *, id> *)data - forDocument:(FIRDocumentReference *)document FIR_SWIFT_NAME(setData(_:forDocument:)); + forDocument:(FIRDocumentReference *)document NS_SWIFT_NAME(setData(_:forDocument:)); // clang-format on /** @@ -67,7 +65,7 @@ FIR_SWIFT_NAME(WriteBatch) - (FIRWriteBatch *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document options:(FIRSetOptions *)options - FIR_SWIFT_NAME(setData(_:forDocument:options:)); + NS_SWIFT_NAME(setData(_:forDocument:options:)); // clang-format on /** @@ -82,7 +80,7 @@ FIR_SWIFT_NAME(WriteBatch) // clang-format off - (FIRWriteBatch *)updateData:(NSDictionary<id, id> *)fields forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(updateData(_:forDocument:)); + NS_SWIFT_NAME(updateData(_:forDocument:)); // clang-format on /** @@ -92,7 +90,7 @@ FIR_SWIFT_NAME(WriteBatch) * @return This `FIRWriteBatch` instance. Used for chaining method calls. */ - (FIRWriteBatch *)deleteDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(deleteDocument(_:)); + NS_SWIFT_NAME(deleteDocument(_:)); /** * Commits all of the writes in this write batch as a single atomic unit. |