From 7386f00178be4fe1f8d8f749049d25cbf0533e6a Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Tue, 28 Nov 2017 06:59:07 -0800 Subject: 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 --- Firebase/Database/Public/FIRDataEventType.h | 3 +-- Firebase/Database/Public/FIRDataSnapshot.h | 3 +-- Firebase/Database/Public/FIRDatabase.h | 9 +++---- Firebase/Database/Public/FIRDatabaseQuery.h | 5 ++-- Firebase/Database/Public/FIRDatabaseReference.h | 3 +-- .../Database/Public/FIRDatabaseSwiftNameSupport.h | 29 ---------------------- Firebase/Database/Public/FIRMutableData.h | 3 +-- Firebase/Database/Public/FIRServerValue.h | 4 +-- Firebase/Database/Public/FIRTransactionResult.h | 3 +-- 9 files changed, 12 insertions(+), 50 deletions(-) delete mode 100644 Firebase/Database/Public/FIRDatabaseSwiftNameSupport.h (limited to 'Firebase/Database') diff --git a/Firebase/Database/Public/FIRDataEventType.h b/Firebase/Database/Public/FIRDataEventType.h index fccc98a..916ce32 100644 --- a/Firebase/Database/Public/FIRDataEventType.h +++ b/Firebase/Database/Public/FIRDataEventType.h @@ -18,7 +18,6 @@ #define Firebase_FIRDataEventType_h #import -#import "FIRDatabaseSwiftNameSupport.h" /** * This enum is the set of events that you can observe at a Firebase Database location. @@ -34,6 +33,6 @@ typedef NS_ENUM(NSInteger, FIRDataEventType) { FIRDataEventTypeChildMoved, /// Any data changes at a location or, recursively, at any child node. FIRDataEventTypeValue -} FIR_SWIFT_NAME(DataEventType); +} NS_SWIFT_NAME(DataEventType); #endif diff --git a/Firebase/Database/Public/FIRDataSnapshot.h b/Firebase/Database/Public/FIRDataSnapshot.h index e465045..02a1e6a 100644 --- a/Firebase/Database/Public/FIRDataSnapshot.h +++ b/Firebase/Database/Public/FIRDataSnapshot.h @@ -15,7 +15,6 @@ */ #import -#import "FIRDatabaseSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * They can't be modified and will never change. To modify data at a location, * use a FIRDatabaseReference (e.g. with setValue:). */ -FIR_SWIFT_NAME(DataSnapshot) +NS_SWIFT_NAME(DataSnapshot) @interface FIRDataSnapshot : NSObject diff --git a/Firebase/Database/Public/FIRDatabase.h b/Firebase/Database/Public/FIRDatabase.h index 606f164..6761669 100644 --- a/Firebase/Database/Public/FIRDatabase.h +++ b/Firebase/Database/Public/FIRDatabase.h @@ -16,7 +16,6 @@ #import #import "FIRDatabaseReference.h" -#import "FIRDatabaseSwiftNameSupport.h" @class FIRApp; @@ -27,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * [FIRDatabase database]. To access a location in the database and read or write data, * use [FIRDatabase reference]. */ -FIR_SWIFT_NAME(Database) +NS_SWIFT_NAME(Database) @interface FIRDatabase : NSObject /** @@ -43,7 +42,7 @@ FIR_SWIFT_NAME(Database) * * @return A FIRDatabase instance. */ -+ (FIRDatabase *) database FIR_SWIFT_NAME(database()); ++ (FIRDatabase *) database NS_SWIFT_NAME(database()); /** * Gets a FirebaseDatabase instance for the specified URL. @@ -72,7 +71,7 @@ FIR_SWIFT_NAME(Database) * @param app The FIRApp to get a FIRDatabase for. * @return A FIRDatabase instance. */ -+ (FIRDatabase *) databaseForApp:(FIRApp *)app FIR_SWIFT_NAME(database(app:)); ++ (FIRDatabase *) databaseForApp:(FIRApp *)app NS_SWIFT_NAME(database(app:)); /** The FIRApp instance to which this FIRDatabase belongs. */ @property (weak, readonly, nonatomic) FIRApp *app; @@ -134,7 +133,7 @@ FIR_SWIFT_NAME(Database) * application. * */ -@property (nonatomic) BOOL persistenceEnabled FIR_SWIFT_NAME(isPersistenceEnabled); +@property (nonatomic) BOOL persistenceEnabled NS_SWIFT_NAME(isPersistenceEnabled); /** * By default the Firebase Database client will use up to 10MB of disk space to cache data. If the cache grows beyond diff --git a/Firebase/Database/Public/FIRDatabaseQuery.h b/Firebase/Database/Public/FIRDatabaseQuery.h index be4ad27..ef56643 100644 --- a/Firebase/Database/Public/FIRDatabaseQuery.h +++ b/Firebase/Database/Public/FIRDatabaseQuery.h @@ -15,7 +15,6 @@ */ #import -#import "FIRDatabaseSwiftNameSupport.h" #import "FIRDataEventType.h" #import "FIRDataSnapshot.h" @@ -26,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN * are returned by observeEventType: and and can later be passed to removeObserverWithHandle: to * stop receiving updates. */ -typedef NSUInteger FIRDatabaseHandle FIR_SWIFT_NAME(DatabaseHandle); +typedef NSUInteger FIRDatabaseHandle NS_SWIFT_NAME(DatabaseHandle); /** * A FIRDatabaseQuery instance represents a query over the data at a particular location. @@ -35,7 +34,7 @@ typedef NSUInteger FIRDatabaseHandle FIR_SWIFT_NAME(DatabaseHandle); * on a FIRDatabaseReference. The query methods can be chained to further specify the data you are interested in * observing */ -FIR_SWIFT_NAME(DatabaseQuery) +NS_SWIFT_NAME(DatabaseQuery) @interface FIRDatabaseQuery : NSObject diff --git a/Firebase/Database/Public/FIRDatabaseReference.h b/Firebase/Database/Public/FIRDatabaseReference.h index 53d0cdd..fdc92b6 100644 --- a/Firebase/Database/Public/FIRDatabaseReference.h +++ b/Firebase/Database/Public/FIRDatabaseReference.h @@ -17,7 +17,6 @@ #import #import "FIRDatabaseQuery.h" #import "FIRDatabase.h" -#import "FIRDatabaseSwiftNameSupport.h" #import "FIRDataSnapshot.h" #import "FIRMutableData.h" #import "FIRTransactionResult.h" @@ -36,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN * to read data (ie. observeEventType:withBlock:), write data (ie. setValue:), and to * create new FIRDatabaseReferences (ie. child:). */ -FIR_SWIFT_NAME(DatabaseReference) +NS_SWIFT_NAME(DatabaseReference) @interface FIRDatabaseReference : FIRDatabaseQuery diff --git a/Firebase/Database/Public/FIRDatabaseSwiftNameSupport.h b/Firebase/Database/Public/FIRDatabaseSwiftNameSupport.h deleted file mode 100644 index 55e1bcc..0000000 --- a/Firebase/Database/Public/FIRDatabaseSwiftNameSupport.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 - -// 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/Firebase/Database/Public/FIRMutableData.h b/Firebase/Database/Public/FIRMutableData.h index 4e7250a..7445d71 100644 --- a/Firebase/Database/Public/FIRMutableData.h +++ b/Firebase/Database/Public/FIRMutableData.h @@ -15,7 +15,6 @@ */ #import -#import "FIRDatabaseSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -35,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN * * Note that changes made to a child FIRMutableData instance will be visible to the parent. */ -FIR_SWIFT_NAME(MutableData) +NS_SWIFT_NAME(MutableData) @interface FIRMutableData : NSObject diff --git a/Firebase/Database/Public/FIRServerValue.h b/Firebase/Database/Public/FIRServerValue.h index f5eadd5..365590c 100644 --- a/Firebase/Database/Public/FIRServerValue.h +++ b/Firebase/Database/Public/FIRServerValue.h @@ -14,15 +14,13 @@ * limitations under the License. */ -#import "FIRDatabaseSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** * Placeholder values you may write into Firebase Database as a value or priority * that will automatically be populated by the Firebase Database server. */ -FIR_SWIFT_NAME(ServerValue) +NS_SWIFT_NAME(ServerValue) @interface FIRServerValue : NSObject /** diff --git a/Firebase/Database/Public/FIRTransactionResult.h b/Firebase/Database/Public/FIRTransactionResult.h index 3c2d39a..d356c5c 100644 --- a/Firebase/Database/Public/FIRTransactionResult.h +++ b/Firebase/Database/Public/FIRTransactionResult.h @@ -15,7 +15,6 @@ */ #import -#import "FIRDatabaseSwiftNameSupport.h" #import "FIRMutableData.h" NS_ASSUME_NONNULL_BEGIN @@ -23,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Used for runTransactionBlock:. An FIRTransactionResult instance is a container for the results of the transaction. */ -FIR_SWIFT_NAME(TransactionResult) +NS_SWIFT_NAME(TransactionResult) @interface FIRTransactionResult : NSObject /** -- cgit v1.2.3