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 /Firebase/Core | |
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 'Firebase/Core')
-rw-r--r-- | Firebase/Core/Public/FIRAnalyticsConfiguration.h | 6 | ||||
-rw-r--r-- | Firebase/Core/Public/FIRApp.h | 16 | ||||
-rw-r--r-- | Firebase/Core/Public/FIRConfiguration.h | 7 | ||||
-rw-r--r-- | Firebase/Core/Public/FIRCoreSwiftNameSupport.h | 29 | ||||
-rw-r--r-- | Firebase/Core/Public/FIRLoggerLevel.h | 4 | ||||
-rw-r--r-- | Firebase/Core/Public/FIROptions.h | 12 |
6 files changed, 18 insertions, 56 deletions
diff --git a/Firebase/Core/Public/FIRAnalyticsConfiguration.h b/Firebase/Core/Public/FIRAnalyticsConfiguration.h index f42eaf5..ca1d32c 100644 --- a/Firebase/Core/Public/FIRAnalyticsConfiguration.h +++ b/Firebase/Core/Public/FIRAnalyticsConfiguration.h @@ -16,20 +16,18 @@ #import <Foundation/Foundation.h> -#import "FIRCoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** * This class provides configuration fields for Firebase Analytics. */ -FIR_SWIFT_NAME(AnalyticsConfiguration) +NS_SWIFT_NAME(AnalyticsConfiguration) @interface FIRAnalyticsConfiguration : NSObject /** * Returns the shared instance of FIRAnalyticsConfiguration. */ -+ (FIRAnalyticsConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); ++ (FIRAnalyticsConfiguration *)sharedInstance NS_SWIFT_NAME(shared()); /** * Sets the minimum engagement time in seconds required to start a new session. The default value diff --git a/Firebase/Core/Public/FIRApp.h b/Firebase/Core/Public/FIRApp.h index dbec0ac..e0d852b 100644 --- a/Firebase/Core/Public/FIRApp.h +++ b/Firebase/Core/Public/FIRApp.h @@ -21,14 +21,12 @@ #import <UIKit/UIKit.h> #endif -#import "FIRCoreSwiftNameSupport.h" - @class FIROptions; NS_ASSUME_NONNULL_BEGIN /** A block that takes a BOOL and has no return value. */ -typedef void (^FIRAppVoidBoolCallback)(BOOL success) FIR_SWIFT_NAME(FirebaseAppVoidBoolCallback); +typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback); /** * The entry point of Firebase SDKs. @@ -48,7 +46,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success) FIR_SWIFT_NAME(FirebaseAppV * It is also possible to change the default logging level in code by calling setLoggerLevel: on * the FIRConfiguration interface. */ -FIR_SWIFT_NAME(FirebaseApp) +NS_SWIFT_NAME(FirebaseApp) @interface FIRApp : NSObject /** @@ -65,7 +63,7 @@ FIR_SWIFT_NAME(FirebaseApp) * * @param options The Firebase application options used to configure the service. */ -+ (void)configureWithOptions:(FIROptions *)options FIR_SWIFT_NAME(configure(options:)); ++ (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:)); /** * Configures a Firebase app with the given name and options. Raises an exception if any @@ -77,19 +75,19 @@ FIR_SWIFT_NAME(FirebaseApp) */ // clang-format off + (void)configureWithName:(NSString *)name - options:(FIROptions *)options FIR_SWIFT_NAME(configure(name:options:)); + options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:)); // clang-format on /** * Returns the default app, or nil if the default app does not exist. */ -+ (nullable FIRApp *)defaultApp FIR_SWIFT_NAME(app()); ++ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app()); /** * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. * This method is thread safe. */ -+ (nullable FIRApp *)appNamed:(NSString *)name FIR_SWIFT_NAME(app(name:)); ++ (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:)); #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** @@ -102,7 +100,7 @@ FIR_SWIFT_NAME(FirebaseApp) * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This * method is thread safe. */ -+ (nullable NSDictionary<NSString *, FIRApp *> *)allApps FIR_SWIFT_NAME(allApps()); ++ (nullable NSDictionary<NSString *, FIRApp *> *)allApps NS_SWIFT_NAME(allApps()); #endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** diff --git a/Firebase/Core/Public/FIRConfiguration.h b/Firebase/Core/Public/FIRConfiguration.h index e2c85e5..05bd261 100644 --- a/Firebase/Core/Public/FIRConfiguration.h +++ b/Firebase/Core/Public/FIRConfiguration.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRAnalyticsConfiguration.h" -#import "FIRCoreSwiftNameSupport.h" #import "FIRLoggerLevel.h" /** @@ -45,15 +44,15 @@ NS_ASSUME_NONNULL_BEGIN * This interface provides global level properties that the developer can tweak, and the singleton * of the Firebase Analytics configuration class. */ -FIR_SWIFT_NAME(FirebaseConfiguration) +NS_SWIFT_NAME(FirebaseConfiguration) @interface FIRConfiguration : NSObject #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** Returns the shared configuration object. */ -@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance FIR_SWIFT_NAME(shared); +@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance NS_SWIFT_NAME(shared); #else /** Returns the shared configuration object. */ -+ (FIRConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); ++ (FIRConfiguration *)sharedInstance NS_SWIFT_NAME(shared()); #endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** The configuration class for Firebase Analytics. */ diff --git a/Firebase/Core/Public/FIRCoreSwiftNameSupport.h b/Firebase/Core/Public/FIRCoreSwiftNameSupport.h deleted file mode 100644 index 216c047..0000000 --- a/Firebase/Core/Public/FIRCoreSwiftNameSupport.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/Firebase/Core/Public/FIRLoggerLevel.h b/Firebase/Core/Public/FIRLoggerLevel.h index 70e99ee..8b6579f 100644 --- a/Firebase/Core/Public/FIRLoggerLevel.h +++ b/Firebase/Core/Public/FIRLoggerLevel.h @@ -14,8 +14,6 @@ * limitations under the License. */ -#import "FIRCoreSwiftNameSupport.h" - /** * The log levels used by internal logging. */ @@ -34,4 +32,4 @@ typedef NS_ENUM(NSInteger, FIRLoggerLevel) { FIRLoggerLevelMin = FIRLoggerLevelError, /** Maximum log level. */ FIRLoggerLevelMax = FIRLoggerLevelDebug -} FIR_SWIFT_NAME(FirebaseLoggerLevel); +} NS_SWIFT_NAME(FirebaseLoggerLevel); diff --git a/Firebase/Core/Public/FIROptions.h b/Firebase/Core/Public/FIROptions.h index e1d114a..eba0657 100644 --- a/Firebase/Core/Public/FIROptions.h +++ b/Firebase/Core/Public/FIROptions.h @@ -16,26 +16,24 @@ #import <Foundation/Foundation.h> -#import "FIRCoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** * This class provides constant fields of Google APIs. */ -FIR_SWIFT_NAME(FirebaseOptions) +NS_SWIFT_NAME(FirebaseOptions) @interface FIROptions : NSObject <NSCopying> /** * Returns the default options. */ -+ (nullable FIROptions *)defaultOptions FIR_SWIFT_NAME(defaultOptions()); ++ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions()); /** * An iOS API key used for authenticating requests from your app, e.g. * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. */ -@property(nonatomic, copy, nullable) NSString *APIKey FIR_SWIFT_NAME(apiKey); +@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey); /** * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set @@ -58,7 +56,7 @@ FIR_SWIFT_NAME(FirebaseOptions) * The Project Number from the Google Developer's console, for example @"012345678901", used to * configure Google Cloud Messaging. */ -@property(nonatomic, copy) NSString *GCMSenderID FIR_SWIFT_NAME(gcmSenderID); +@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID); /** * The Project ID from the Firebase console, for example @"abc-xyz-123". @@ -127,7 +125,7 @@ FIR_SWIFT_NAME(FirebaseOptions) // clang-format off - (instancetype)initWithGoogleAppID:(NSString *)googleAppID GCMSenderID:(NSString *)GCMSenderID - FIR_SWIFT_NAME(init(googleAppID:gcmSenderID:)); + NS_SWIFT_NAME(init(googleAppID:gcmSenderID:)); // clang-format on @end |