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 | |
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')
47 files changed, 156 insertions, 348 deletions
diff --git a/Firebase/Auth/Source/Public/FIRActionCodeSettings.h b/Firebase/Auth/Source/Public/FIRActionCodeSettings.h index d0a54e4..6eb4c89 100644 --- a/Firebase/Auth/Source/Public/FIRActionCodeSettings.h +++ b/Firebase/Auth/Source/Public/FIRActionCodeSettings.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> - #import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @class FIRActionCodeSettings @brief Used to set and retrieve settings related to handling action codes. */ - FIR_SWIFT_NAME(ActionCodeSettings) + NS_SWIFT_NAME(ActionCodeSettings) @interface FIRActionCodeSettings : NSObject /** @property URL diff --git a/Firebase/Auth/Source/Public/FIRAdditionalUserInfo.h b/Firebase/Auth/Source/Public/FIRAdditionalUserInfo.h index 44c3646..36dd3aa 100644 --- a/Firebase/Auth/Source/Public/FIRAdditionalUserInfo.h +++ b/Firebase/Auth/Source/Public/FIRAdditionalUserInfo.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRVerifyAssertionResponse; NS_ASSUME_NONNULL_BEGIN @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN /** @class FIRAdditionalUserInfo @brief Represents additional user data returned from an identity provider. */ -FIR_SWIFT_NAME(AdditionalUserInfo) +NS_SWIFT_NAME(AdditionalUserInfo) @interface FIRAdditionalUserInfo : NSObject /** @fn init diff --git a/Firebase/Auth/Source/Public/FIRAuth.h b/Firebase/Auth/Source/Public/FIRAuth.h index 2935916..42b3ac5 100644 --- a/Firebase/Auth/Source/Public/FIRAuth.h +++ b/Firebase/Auth/Source/Public/FIRAuth.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRAuthErrors.h" -#import "FIRAuthSwiftNameSupport.h" #if TARGET_OS_IOS #import "FIRAuthAPNSTokenType.h" @@ -37,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN @brief The type of handle returned by @c FIRAuth.addAuthStateDidChangeListener:. */ typedef id<NSObject> FIRAuthStateDidChangeListenerHandle - FIR_SWIFT_NAME(AuthStateDidChangeListenerHandle); + NS_SWIFT_NAME(AuthStateDidChangeListenerHandle); /** @typedef FIRAuthStateDidChangeListenerBlock @brief The type of block which can be registered as a listener for auth state did change events. @@ -46,13 +45,13 @@ typedef id<NSObject> FIRAuthStateDidChangeListenerHandle @param user Optionally; the current signed in user, if any. */ typedef void(^FIRAuthStateDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user) - FIR_SWIFT_NAME(AuthStateDidChangeListenerBlock); + NS_SWIFT_NAME(AuthStateDidChangeListenerBlock); /** @typedef FIRIDTokenDidChangeListenerHandle @brief The type of handle returned by @c FIRAuth.addIDTokenDidChangeListener:. */ typedef id<NSObject> FIRIDTokenDidChangeListenerHandle - FIR_SWIFT_NAME(IDTokenDidChangeListenerHandle); + NS_SWIFT_NAME(IDTokenDidChangeListenerHandle); /** @typedef FIRIDTokenDidChangeListenerBlock @brief The type of block which can be registered as a listener for ID token did change events. @@ -61,7 +60,7 @@ typedef id<NSObject> FIRIDTokenDidChangeListenerHandle @param user Optionally; the current signed in user, if any. */ typedef void(^FIRIDTokenDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user) - FIR_SWIFT_NAME(IDTokenDidChangeListenerBlock); + NS_SWIFT_NAME(IDTokenDidChangeListenerBlock); /** @typedef FIRAuthDataResultCallback @brief The type of block invoked when sign-in related events complete. @@ -72,7 +71,7 @@ typedef void(^FIRIDTokenDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullabl */ typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error) - FIR_SWIFT_NAME(AuthDataResultCallback); + NS_SWIFT_NAME(AuthDataResultCallback); #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** @@ -81,7 +80,7 @@ typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResul object parameter of the notification is the sender @c FIRAuth instance. */ extern const NSNotificationName FIRAuthStateDidChangeNotification - FIR_SWIFT_NAME(AuthStateDidChange); + NS_SWIFT_NAME(AuthStateDidChange); #else /** @brief The name of the @c NSNotificationCenter notification which is posted when the auth state @@ -89,7 +88,7 @@ extern const NSNotificationName FIRAuthStateDidChangeNotification object parameter of the notification is the sender @c FIRAuth instance. */ extern NSString *const FIRAuthStateDidChangeNotification - FIR_SWIFT_NAME(AuthStateDidChangeNotification); + NS_SWIFT_NAME(AuthStateDidChangeNotification); #endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** @typedef FIRAuthResultCallback @@ -100,7 +99,7 @@ extern NSString *const FIRAuthStateDidChangeNotification problem. Set to nil otherwise. */ typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error) - FIR_SWIFT_NAME(AuthResultCallback); + NS_SWIFT_NAME(AuthResultCallback); /** @typedef FIRProviderQueryCallback @brief The type of block invoked when a list of identity providers for a given email address is @@ -113,7 +112,7 @@ typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullabl */ typedef void (^FIRProviderQueryCallback)(NSArray<NSString *> *_Nullable providers, NSError *_Nullable error) - FIR_SWIFT_NAME(ProviderQueryCallback); + NS_SWIFT_NAME(ProviderQueryCallback); /** @typedef FIRSendPasswordResetCallback @brief The type of block invoked when sending a password reset email. @@ -122,7 +121,7 @@ typedef void (^FIRProviderQueryCallback)(NSArray<NSString *> *_Nullable provider problem. Set to nil otherwise. */ typedef void (^FIRSendPasswordResetCallback)(NSError *_Nullable error) - FIR_SWIFT_NAME(SendPasswordResetCallback); + NS_SWIFT_NAME(SendPasswordResetCallback); /** @typedef FIRConfirmPasswordResetCallback @brief The type of block invoked when performing a password reset. @@ -131,7 +130,7 @@ typedef void (^FIRSendPasswordResetCallback)(NSError *_Nullable error) problem. Set to nil otherwise. */ typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error) - FIR_SWIFT_NAME(ConfirmPasswordResetCallback); + NS_SWIFT_NAME(ConfirmPasswordResetCallback); /** @typedef FIRVerifyPasswordResetCodeCallback @brief The type of block invoked when verifying that an out of band code should be used to @@ -143,7 +142,7 @@ typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error) */ typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email, NSError *_Nullable error) - FIR_SWIFT_NAME(VerifyPasswordResetCodeCallback); + NS_SWIFT_NAME(VerifyPasswordResetCodeCallback); /** @typedef FIRApplyActionCodeCallback @brief The type of block invoked when applying an action code. @@ -152,7 +151,7 @@ typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email, problem. Set to nil otherwise. */ typedef void (^FIRApplyActionCodeCallback)(NSError *_Nullable error) - FIR_SWIFT_NAME(ApplyActionCodeCallback); + NS_SWIFT_NAME(ApplyActionCodeCallback); /** @brief Keys used to retrieve operation data from a @c FIRActionCodeInfo object by the @@ -167,12 +166,12 @@ typedef NS_ENUM(NSInteger, FIRActionDataKey) { /** For FIRActionCodeOperationRecoverEmail, the current email address for the account. */ FIRActionCodeFromEmailKey = 1 -} FIR_SWIFT_NAME(ActionDataKey); +} NS_SWIFT_NAME(ActionDataKey); /** @class FIRActionCodeInfo @brief Manages information regarding action codes. */ -FIR_SWIFT_NAME(ActionCodeInfo) +NS_SWIFT_NAME(ActionCodeInfo) @interface FIRActionCodeInfo : NSObject /** @@ -191,7 +190,7 @@ typedef NS_ENUM(NSInteger, FIRActionCodeOperation) { /** Action code for recover email operation. */ FIRActionCodeOperationRecoverEmail = 3, -} FIR_SWIFT_NAME(ActionCodeOperation); +} NS_SWIFT_NAME(ActionCodeOperation); /** @brief The operation being performed. @@ -223,13 +222,13 @@ typedef NS_ENUM(NSInteger, FIRActionCodeOperation) { */ typedef void (^FIRCheckActionCodeCallBack)(FIRActionCodeInfo *_Nullable info, NSError *_Nullable error) - FIR_SWIFT_NAME(CheckActionCodeCallback); + NS_SWIFT_NAME(CheckActionCodeCallback); /** @class FIRAuth @brief Manages authentication for Firebase apps. @remarks This class is thread-safe. */ -FIR_SWIFT_NAME(Auth) +NS_SWIFT_NAME(Auth) @interface FIRAuth : NSObject /** @fn auth @@ -237,7 +236,7 @@ FIR_SWIFT_NAME(Auth) @remarks The default Firebase app must have already been configured or an exception will be raised. */ -+ (FIRAuth *)auth FIR_SWIFT_NAME(auth()); ++ (FIRAuth *)auth NS_SWIFT_NAME(auth()); /** @fn authWithApp: @brief Gets the auth object for a @c FIRApp. @@ -245,7 +244,7 @@ FIR_SWIFT_NAME(Auth) @param app The FIRApp for which to retrieve the associated FIRAuth instance. @return The FIRAuth instance associated with the given FIRApp. */ -+ (FIRAuth *)authWithApp:(FIRApp *)app FIR_SWIFT_NAME(auth(app:)); ++ (FIRAuth *)authWithApp:(FIRApp *)app NS_SWIFT_NAME(auth(app:)); /** @property app @brief Gets the @c FIRApp object that this auth object is connected to. diff --git a/Firebase/Auth/Source/Public/FIRAuthAPNSTokenType.h b/Firebase/Auth/Source/Public/FIRAuthAPNSTokenType.h index 87df574..4f3c9f6 100644 --- a/Firebase/Auth/Source/Public/FIRAuthAPNSTokenType.h +++ b/Firebase/Auth/Source/Public/FIRAuthAPNSTokenType.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -37,6 +35,6 @@ typedef NS_ENUM(NSInteger, FIRAuthAPNSTokenType) { /** Production token type. */ FIRAuthAPNSTokenTypeProd, -} FIR_SWIFT_NAME(AuthAPNSTokenType); +} NS_SWIFT_NAME(AuthAPNSTokenType); NS_ASSUME_NONNULL_END diff --git a/Firebase/Auth/Source/Public/FIRAuthCredential.h b/Firebase/Auth/Source/Public/FIRAuthCredential.h index ce28854..106d844 100644 --- a/Firebase/Auth/Source/Public/FIRAuthCredential.h +++ b/Firebase/Auth/Source/Public/FIRAuthCredential.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @class FIRAuthCredential @brief Represents a credential. */ -FIR_SWIFT_NAME(AuthCredential) +NS_SWIFT_NAME(AuthCredential) @interface FIRAuthCredential : NSObject /** @property provider diff --git a/Firebase/Auth/Source/Public/FIRAuthDataResult.h b/Firebase/Auth/Source/Public/FIRAuthDataResult.h index b7f3ee0..ba16576 100644 --- a/Firebase/Auth/Source/Public/FIRAuthDataResult.h +++ b/Firebase/Auth/Source/Public/FIRAuthDataResult.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAdditionalUserInfo; @class FIRUser; @@ -27,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @brief Helper object that contains the result of a successful sign-in, link and reauthenticate action. It contains references to a FIRUser instance and a FIRAdditionalUserInfo instance. */ -FIR_SWIFT_NAME(AuthDataResult) +NS_SWIFT_NAME(AuthDataResult) @interface FIRAuthDataResult : NSObject /** @fn init diff --git a/Firebase/Auth/Source/Public/FIRAuthErrors.h b/Firebase/Auth/Source/Public/FIRAuthErrors.h index 1691228..fdfee19 100644 --- a/Firebase/Auth/Source/Public/FIRAuthErrors.h +++ b/Firebase/Auth/Source/Public/FIRAuthErrors.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - /** @class FIRAuthErrors @remarks Error Codes common to all API Methods: <ul> @@ -36,31 +34,31 @@ <li>@c FIRAuthErrorCodeUserDisabled</li> </ul> */ -FIR_SWIFT_NAME(AuthErrors) +NS_SWIFT_NAME(AuthErrors) @interface FIRAuthErrors /** @brief The Firebase Auth error domain. */ -extern NSString *const FIRAuthErrorDomain FIR_SWIFT_NAME(AuthErrorDomain); +extern NSString *const FIRAuthErrorDomain NS_SWIFT_NAME(AuthErrorDomain); /** @brief The key used to read the updated credential from the userinfo dictionary of the NSError object returned in the case that the credential being linked in already in use. */ -extern NSString *const FIRAuthUpdatedCredentialKey FIR_SWIFT_NAME(AuthUpdatedCredentialKey); +extern NSString *const FIRAuthUpdatedCredentialKey NS_SWIFT_NAME(AuthUpdatedCredentialKey); /** @brief The name of the key for the "error_name" string in the NSError userinfo dictionary. */ -extern NSString *const FIRAuthErrorNameKey FIR_SWIFT_NAME(AuthErrorNameKey); +extern NSString *const FIRAuthErrorNameKey NS_SWIFT_NAME(AuthErrorNameKey); /** @brief Errors with the code @c FIRAuthErrorCodeAccountExistsWithDifferentCredential may contain an @c NSError.userInfo dictinary object which contains this key. The value associated with this key is an NSString of the email address of the account that already exists. */ -extern NSString *const FIRAuthErrorUserInfoEmailKey FIR_SWIFT_NAME(AuthErrorUserInfoEmailKey); +extern NSString *const FIRAuthErrorUserInfoEmailKey NS_SWIFT_NAME(AuthErrorUserInfoEmailKey); /** @brief Error codes used by Firebase Auth. @@ -308,6 +306,6 @@ typedef NS_ENUM(NSInteger, FIRAuthErrorCode) { /** Indicates an internal error occurred. */ FIRAuthErrorCodeInternalError = 17999, -} FIR_SWIFT_NAME(AuthErrorCode); +} NS_SWIFT_NAME(AuthErrorCode); @end diff --git a/Firebase/Auth/Source/Public/FIRAuthSwiftNameSupport.h b/Firebase/Auth/Source/Public/FIRAuthSwiftNameSupport.h deleted file mode 100644 index 55e1bcc..0000000 --- a/Firebase/Auth/Source/Public/FIRAuthSwiftNameSupport.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/Auth/Source/Public/FIRAuthUIDelegate.h b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h index 5fc5dc5..9b32968 100644 --- a/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h +++ b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h @@ -17,14 +17,12 @@ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> -#import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @protocol FIRAuthUIDelegate @brief A protocol to handle user interface interactions for Firebase Auth. */ -FIR_SWIFT_NAME(AuthUIDelegate) +NS_SWIFT_NAME(AuthUIDelegate) @protocol FIRAuthUIDelegate <NSObject> /** @fn presentViewController:animated:completion: @@ -47,7 +45,7 @@ FIR_SWIFT_NAME(AuthUIDelegate) value and takes no parameters. */ - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^ _Nullable)(void))completion - FIR_SWIFT_NAME(dismiss(animated:completion:)); + NS_SWIFT_NAME(dismiss(animated:completion:)); @end diff --git a/Firebase/Auth/Source/Public/FIREmailAuthProvider.h b/Firebase/Auth/Source/Public/FIREmailAuthProvider.h index 4fb5ea0..030efda 100644 --- a/Firebase/Auth/Source/Public/FIREmailAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIREmailAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN /** @brief A string constant identifying the email & password identity provider. */ -extern NSString *const FIREmailAuthProviderID FIR_SWIFT_NAME(EmailAuthProviderID); +extern NSString *const FIREmailAuthProviderID NS_SWIFT_NAME(EmailAuthProviderID); /** @brief please use @c FIREmailAuthProviderID instead. @@ -35,7 +33,7 @@ extern NSString *const FIREmailPasswordAuthProviderID __attribute__((deprecated) /** @class FIREmailAuthProvider @brief A concrete implementation of @c FIRAuthProvider for Email & Password Sign In. */ -FIR_SWIFT_NAME(EmailAuthProvider) +NS_SWIFT_NAME(EmailAuthProvider) @interface FIREmailAuthProvider : NSObject /** @typedef FIREmailPasswordAuthProvider diff --git a/Firebase/Auth/Source/Public/FIRFacebookAuthProvider.h b/Firebase/Auth/Source/Public/FIRFacebookAuthProvider.h index 2307b08..dae90dc 100644 --- a/Firebase/Auth/Source/Public/FIRFacebookAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRFacebookAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,12 +23,12 @@ NS_ASSUME_NONNULL_BEGIN /** @brief A string constant identifying the Facebook identity provider. */ -extern NSString *const FIRFacebookAuthProviderID FIR_SWIFT_NAME(FacebookAuthProviderID); +extern NSString *const FIRFacebookAuthProviderID NS_SWIFT_NAME(FacebookAuthProviderID); /** @class FIRFacebookAuthProvider @brief Utility class for constructing Facebook credentials. */ -FIR_SWIFT_NAME(FacebookAuthProvider) +NS_SWIFT_NAME(FacebookAuthProvider) @interface FIRFacebookAuthProvider : NSObject /** @fn credentialWithAccessToken: diff --git a/Firebase/Auth/Source/Public/FIRGitHubAuthProvider.h b/Firebase/Auth/Source/Public/FIRGitHubAuthProvider.h index ab5c0ef..0da3142 100644 --- a/Firebase/Auth/Source/Public/FIRGitHubAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRGitHubAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,12 +23,12 @@ NS_ASSUME_NONNULL_BEGIN /** @brief A string constant identifying the GitHub identity provider. */ -extern NSString *const FIRGitHubAuthProviderID FIR_SWIFT_NAME(GitHubAuthProviderID); +extern NSString *const FIRGitHubAuthProviderID NS_SWIFT_NAME(GitHubAuthProviderID); /** @class FIRGitHubAuthProvider @brief Utility class for constructing GitHub credentials. */ -FIR_SWIFT_NAME(GitHubAuthProvider) +NS_SWIFT_NAME(GitHubAuthProvider) @interface FIRGitHubAuthProvider : NSObject /** @fn credentialWithToken: diff --git a/Firebase/Auth/Source/Public/FIRGoogleAuthProvider.h b/Firebase/Auth/Source/Public/FIRGoogleAuthProvider.h index 92f0db2..1386c04 100644 --- a/Firebase/Auth/Source/Public/FIRGoogleAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRGoogleAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,12 +23,12 @@ NS_ASSUME_NONNULL_BEGIN /** @brief A string constant identifying the Google identity provider. */ -extern NSString *const FIRGoogleAuthProviderID FIR_SWIFT_NAME(GoogleAuthProviderID); +extern NSString *const FIRGoogleAuthProviderID NS_SWIFT_NAME(GoogleAuthProviderID); /** @class FIRGoogleAuthProvider @brief Utility class for constructing Google Sign In credentials. */ -FIR_SWIFT_NAME(GoogleAuthProvider) +NS_SWIFT_NAME(GoogleAuthProvider) @interface FIRGoogleAuthProvider : NSObject /** @fn credentialWithIDToken:accessToken: diff --git a/Firebase/Auth/Source/Public/FIROAuthProvider.h b/Firebase/Auth/Source/Public/FIROAuthProvider.h index e059b22..b20d9b6 100644 --- a/Firebase/Auth/Source/Public/FIROAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIROAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN /** @class FIROAuthProvider @brief A concrete implementation of @c FIRAuthProvider for generic OAuth Providers. */ -FIR_SWIFT_NAME(OAuthProvider) +NS_SWIFT_NAME(OAuthProvider) @interface FIROAuthProvider : NSObject /** @fn credentialWithProviderID:IDToken:accessToken: diff --git a/Firebase/Auth/Source/Public/FIRPhoneAuthCredential.h b/Firebase/Auth/Source/Public/FIRPhoneAuthCredential.h index d951564..26dfca8 100644 --- a/Firebase/Auth/Source/Public/FIRPhoneAuthCredential.h +++ b/Firebase/Auth/Source/Public/FIRPhoneAuthCredential.h @@ -17,14 +17,13 @@ #import <Foundation/Foundation.h> #import "FIRAuthCredential.h" -#import "FIRAuthSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN /** @class FIRPhoneAuthCredential @brief Implementation of FIRAuthCredential for Phone Auth credentials. */ -FIR_SWIFT_NAME(PhoneAuthCredential) +NS_SWIFT_NAME(PhoneAuthCredential) @interface FIRPhoneAuthCredential : FIRAuthCredential /** @fn init diff --git a/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h b/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h index 90cfebd..2d6d698 100644 --- a/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuth; @class FIRPhoneAuthCredential; @protocol FIRAuthUIDelegate; @@ -27,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN /** @var FIRPhoneAuthProviderID @brief A string constant identifying the phone identity provider. */ -extern NSString *const FIRPhoneAuthProviderID FIR_SWIFT_NAME(PhoneAuthProviderID); +extern NSString *const FIRPhoneAuthProviderID NS_SWIFT_NAME(PhoneAuthProviderID); /** @typedef FIRVerificationResultCallback @brief The type of block invoked when a request to send a verification code has finished. @@ -37,25 +35,25 @@ extern NSString *const FIRPhoneAuthProviderID FIR_SWIFT_NAME(PhoneAuthProviderID */ typedef void (^FIRVerificationResultCallback)(NSString *_Nullable verificationID, NSError *_Nullable error) - FIR_SWIFT_NAME(VerificationResultCallback); + NS_SWIFT_NAME(VerificationResultCallback); /** @class FIRPhoneAuthProvider @brief A concrete implementation of @c FIRAuthProvider for phone auth providers. */ -FIR_SWIFT_NAME(PhoneAuthProvider) +NS_SWIFT_NAME(PhoneAuthProvider) @interface FIRPhoneAuthProvider : NSObject /** @fn provider @brief Returns an instance of @c FIRPhoneAuthProvider for the default @c FIRAuth object. */ -+ (instancetype)provider FIR_SWIFT_NAME(provider()); ++ (instancetype)provider NS_SWIFT_NAME(provider()); /** @fn providerWithAuth: @brief Returns an instance of @c FIRPhoneAuthProvider for the provided @c FIRAuth object. @param auth The auth object to associate with the phone auth provider instance. */ -+ (instancetype)providerWithAuth:(FIRAuth *)auth FIR_SWIFT_NAME(provider(auth:)); ++ (instancetype)providerWithAuth:(FIRAuth *)auth NS_SWIFT_NAME(provider(auth:)); /** @fn verifyPhoneNumber:completion: @brief Please use @c verifyPhoneNumber:UIDelegate:completion: instead. diff --git a/Firebase/Auth/Source/Public/FIRTwitterAuthProvider.h b/Firebase/Auth/Source/Public/FIRTwitterAuthProvider.h index d8f647d..4200753 100644 --- a/Firebase/Auth/Source/Public/FIRTwitterAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRTwitterAuthProvider.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - @class FIRAuthCredential; NS_ASSUME_NONNULL_BEGIN @@ -25,12 +23,12 @@ NS_ASSUME_NONNULL_BEGIN /** @brief A string constant identifying the Twitter identity provider. */ -extern NSString *const FIRTwitterAuthProviderID FIR_SWIFT_NAME(TwitterAuthProviderID); +extern NSString *const FIRTwitterAuthProviderID NS_SWIFT_NAME(TwitterAuthProviderID); /** @class FIRTwitterAuthProvider @brief Utility class for constructing Twitter credentials. */ -FIR_SWIFT_NAME(TwitterAuthProvider) +NS_SWIFT_NAME(TwitterAuthProvider) @interface FIRTwitterAuthProvider : NSObject /** @fn credentialWithToken:secret: diff --git a/Firebase/Auth/Source/Public/FIRUser.h b/Firebase/Auth/Source/Public/FIRUser.h index f0a5619..7e22329 100644 --- a/Firebase/Auth/Source/Public/FIRUser.h +++ b/Firebase/Auth/Source/Public/FIRUser.h @@ -18,7 +18,6 @@ #import "FIRAuth.h" #import "FIRAuthDataResult.h" -#import "FIRAuthSwiftNameSupport.h" #import "FIRUserInfo.h" @class FIRPhoneAuthCredential; @@ -38,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @remarks One of: @c token or @c error will always be non-nil. */ typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error) - FIR_SWIFT_NAME(AuthTokenCallback); + NS_SWIFT_NAME(AuthTokenCallback); /** @typedef FIRUserProfileChangeCallback @brief The type of block called when a user profile change has finished. @@ -46,7 +45,7 @@ typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullab @param error Optionally; the error which occurred - or nil if the request was successful. */ typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error) - FIR_SWIFT_NAME(UserProfileChangeCallback); + NS_SWIFT_NAME(UserProfileChangeCallback); /** @typedef FIRSendEmailVerificationCallback @brief The type of block called when a request to send an email verification has finished. @@ -54,13 +53,13 @@ typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error) @param error Optionally; the error which occurred - or nil if the request was successful. */ typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error) - FIR_SWIFT_NAME(SendEmailVerificationCallback); + NS_SWIFT_NAME(SendEmailVerificationCallback); /** @class FIRUser @brief Represents a user. @remarks This class is thread-safe. */ -FIR_SWIFT_NAME(User) +NS_SWIFT_NAME(User) @interface FIRUser : NSObject <FIRUserInfo> /** @property anonymous @@ -133,7 +132,7 @@ FIR_SWIFT_NAME(User) @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. */ - (void)updateEmail:(NSString *)email completion:(nullable FIRUserProfileChangeCallback)completion - FIR_SWIFT_NAME(updateEmail(to:completion:)); + NS_SWIFT_NAME(updateEmail(to:completion:)); /** @fn updatePassword:completion: @brief Updates the password for the user. On success, the cached user profile data is updated. @@ -162,7 +161,7 @@ FIR_SWIFT_NAME(User) */ - (void)updatePassword:(NSString *)password completion:(nullable FIRUserProfileChangeCallback)completion - FIR_SWIFT_NAME(updatePassword(to:completion:)); + NS_SWIFT_NAME(updatePassword(to:completion:)); #if TARGET_OS_IOS /** @fn updatePhoneNumberCredential:completion: @@ -198,7 +197,7 @@ FIR_SWIFT_NAME(User) @return An object which may be used to change the user's profile data atomically. */ -- (FIRUserProfileChangeRequest *)profileChangeRequest FIR_SWIFT_NAME(createProfileChangeRequest()); +- (FIRUserProfileChangeRequest *)profileChangeRequest NS_SWIFT_NAME(createProfileChangeRequest()); /** @fn reloadWithCompletion: @brief Reloads the user's profile data from the server. @@ -275,7 +274,7 @@ FIR_SWIFT_NAME(User) @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. */ - (void)getIDTokenWithCompletion:(nullable FIRAuthTokenCallback)completion - FIR_SWIFT_NAME(getIDToken(completion:)); + NS_SWIFT_NAME(getIDToken(completion:)); /** @fn getTokenWithCompletion: @brief Please use @c getIDTokenWithCompletion: instead. @@ -286,7 +285,7 @@ FIR_SWIFT_NAME(User) @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. */ - (void)getTokenWithCompletion:(nullable FIRAuthTokenCallback)completion - FIR_SWIFT_NAME(getToken(completion:)) __attribute__((deprecated)); + NS_SWIFT_NAME(getToken(completion:)) __attribute__((deprecated)); /** @fn getIDTokenForcingRefresh:completion: @brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired. @@ -470,7 +469,7 @@ FIR_SWIFT_NAME(User) @remarks Properties are marked as being part of a profile update when they are set. Setting a property value to nil is not the same as leaving the property unassigned. */ -FIR_SWIFT_NAME(UserProfileChangeRequest) +NS_SWIFT_NAME(UserProfileChangeRequest) @interface FIRUserProfileChangeRequest : NSObject /** @fn init diff --git a/Firebase/Auth/Source/Public/FIRUserInfo.h b/Firebase/Auth/Source/Public/FIRUserInfo.h index 03f2038..04eca49 100644 --- a/Firebase/Auth/Source/Public/FIRUserInfo.h +++ b/Firebase/Auth/Source/Public/FIRUserInfo.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @brief Represents user data returned from an identity provider. */ -FIR_SWIFT_NAME(UserInfo) +NS_SWIFT_NAME(UserInfo) @protocol FIRUserInfo <NSObject> /** @property providerID diff --git a/Firebase/Auth/Source/Public/FIRUserMetadata.h b/Firebase/Auth/Source/Public/FIRUserMetadata.h index 1b72ee1..2533171 100644 --- a/Firebase/Auth/Source/Public/FIRUserMetadata.h +++ b/Firebase/Auth/Source/Public/FIRUserMetadata.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> -#import "FIRAuthSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @class FIRUserMetdata @brief A data class representing the metadata corresponding to a Firebase user. */ -FIR_SWIFT_NAME(UserMetadata) +NS_SWIFT_NAME(UserMetadata) @interface FIRUserMetadata : NSObject /** @property lastSignInDate diff --git a/Firebase/Auth/Source/Public/FirebaseAuth.h b/Firebase/Auth/Source/Public/FirebaseAuth.h index 0cc5905..409ac73 100644 --- a/Firebase/Auth/Source/Public/FirebaseAuth.h +++ b/Firebase/Auth/Source/Public/FirebaseAuth.h @@ -22,7 +22,6 @@ #import "FIRAuthCredential.h" #import "FIRAuthDataResult.h" #import "FIRAuthErrors.h" -#import "FIRAuthSwiftNameSupport.h" #import "FirebaseAuthVersion.h" #import "FIREmailAuthProvider.h" #import "FIRFacebookAuthProvider.h" 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 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 <Foundation/Foundation.h> -#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 <Foundation/Foundation.h> -#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 <Foundation/Foundation.h> #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 <Foundation/Foundation.h> -#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 <Foundation/Foundation.h> #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 <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/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 <Foundation/Foundation.h> -#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 <Foundation/Foundation.h> -#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 /** diff --git a/Firebase/Messaging/Public/FIRMessaging.h b/Firebase/Messaging/Public/FIRMessaging.h index 65a9d06..7cd7b19 100644 --- a/Firebase/Messaging/Public/FIRMessaging.h +++ b/Firebase/Messaging/Public/FIRMessaging.h @@ -16,17 +16,6 @@ #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. -#ifndef FIR_SWIFT_NAME -#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 // #ifndef FIR_SWIFT_NAME - /** * @related FIRMessaging * @@ -40,7 +29,7 @@ */ typedef void(^FIRMessagingFCMTokenFetchCompletion)(NSString * _Nullable FCMToken, NSError * _Nullable error) - FIR_SWIFT_NAME(MessagingFCMTokenFetchCompletion); + NS_SWIFT_NAME(MessagingFCMTokenFetchCompletion); /** @@ -54,7 +43,7 @@ typedef void(^FIRMessagingFCMTokenFetchCompletion)(NSString * _Nullable FCMToken * will match a value from the FIRMessagingError enumeration. */ typedef void(^FIRMessagingDeleteFCMTokenCompletion)(NSError * _Nullable error) - FIR_SWIFT_NAME(MessagingDeleteFCMTokenCompletion); + NS_SWIFT_NAME(MessagingDeleteFCMTokenCompletion); /** * The completion handler invoked once the data connection with FIRMessaging is @@ -69,7 +58,7 @@ typedef void(^FIRMessagingDeleteFCMTokenCompletion)(NSError * _Nullable error) * to FIRMessaging failed. */ typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error) - FIR_SWIFT_NAME(MessagingConnectCompletion) + NS_SWIFT_NAME(MessagingConnectCompletion) __deprecated_msg("Please listen for the FIRMessagingConnectionStateChangedNotification " "NSNotification instead."); @@ -80,7 +69,7 @@ typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error) * of the successfully delivered message. */ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendSuccessNotification - FIR_SWIFT_NAME(MessagingSendSuccess); + NS_SWIFT_NAME(MessagingSendSuccess); /** * Notification sent when the upstream message was failed to be sent to the @@ -89,7 +78,7 @@ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendSuccessNoti * information for the failure. */ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendErrorNotification - FIR_SWIFT_NAME(MessagingSendError); + NS_SWIFT_NAME(MessagingSendError); /** * Notification sent when the Firebase messaging server deletes pending @@ -100,7 +89,7 @@ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendErrorNotifi * server. */ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingMessagesDeletedNotification - FIR_SWIFT_NAME(MessagingMessagesDeleted); + NS_SWIFT_NAME(MessagingMessagesDeleted); /** * Notification sent when Firebase Messaging establishes or disconnects from @@ -108,7 +97,7 @@ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingMessagesDeleted * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. */ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingConnectionStateChangedNotification - FIR_SWIFT_NAME(MessagingConnectionStateChanged); + NS_SWIFT_NAME(MessagingConnectionStateChanged); /** * Notification sent when the FCM registration token has been refreshed. Please use the @@ -117,7 +106,7 @@ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingConnectionState */ FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingRegistrationTokenRefreshedNotification - FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshed); + NS_SWIFT_NAME(MessagingRegistrationTokenRefreshed); #else /** * Notification sent when the upstream message has been delivered @@ -125,7 +114,7 @@ FOUNDATION_EXPORT const NSNotificationName __nonnull * of the successfully delivered message. */ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification - FIR_SWIFT_NAME(MessagingSendSuccessNotification); + NS_SWIFT_NAME(MessagingSendSuccessNotification); /** * Notification sent when the upstream message was failed to be sent to the @@ -134,7 +123,7 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification * information for the failure. */ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification - FIR_SWIFT_NAME(MessagingSendErrorNotification); + NS_SWIFT_NAME(MessagingSendErrorNotification); /** * Notification sent when the Firebase messaging server deletes pending @@ -145,7 +134,7 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification * server. */ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification - FIR_SWIFT_NAME(MessagingMessagesDeletedNotification); + NS_SWIFT_NAME(MessagingMessagesDeletedNotification); /** * Notification sent when Firebase Messaging establishes or disconnects from @@ -153,7 +142,7 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotifica * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. */ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingConnectionStateChangedNotification - FIR_SWIFT_NAME(MessagingConnectionStateChangedNotification); + NS_SWIFT_NAME(MessagingConnectionStateChangedNotification); /** * Notification sent when the FCM registration token has been refreshed. Please use the @@ -161,7 +150,7 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingConnectionStateChangedN * updated tokens. */ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingRegistrationTokenRefreshedNotification - FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshedNotification); + NS_SWIFT_NAME(MessagingRegistrationTokenRefreshedNotification); #endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** @@ -188,7 +177,7 @@ typedef NS_ENUM(NSUInteger, FIRMessagingError) { /// Some parameters of the request were invalid. FIRMessagingErrorInvalidRequest = 7, -} FIR_SWIFT_NAME(MessagingError); +} NS_SWIFT_NAME(MessagingError); /// Status for the downstream message received by the app. typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { @@ -196,7 +185,7 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { FIRMessagingMessageStatusUnknown, /// New downstream message received by the app. FIRMessagingMessageStatusNew, -} FIR_SWIFT_NAME(MessagingMessageStatus); +} NS_SWIFT_NAME(MessagingMessageStatus); /** * The APNS token type for the app. If the token type is set to `UNKNOWN` @@ -212,10 +201,10 @@ typedef NS_ENUM(NSInteger, FIRMessagingAPNSTokenType) { FIRMessagingAPNSTokenTypeSandbox, /// Production token type. FIRMessagingAPNSTokenTypeProd, -} FIR_SWIFT_NAME(MessagingAPNSTokenType); +} NS_SWIFT_NAME(MessagingAPNSTokenType); /// Information about a downstream message received by the app. -FIR_SWIFT_NAME(MessagingMessageInfo) +NS_SWIFT_NAME(MessagingMessageInfo) @interface FIRMessagingMessageInfo : NSObject /// The status of the downstream message @@ -229,7 +218,7 @@ FIR_SWIFT_NAME(MessagingMessageInfo) * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use * the local and remote notifications handlers defined in UIApplicationDelegate protocol. */ -FIR_SWIFT_NAME(MessagingRemoteMessage) +NS_SWIFT_NAME(MessagingRemoteMessage) @interface FIRMessagingRemoteMessage : NSObject /// The downstream message received by the application. @@ -243,7 +232,7 @@ FIR_SWIFT_NAME(MessagingRemoteMessage) * To support devices running iOS 9 or below, use the local and remote notifications handlers * defined in UIApplicationDelegate protocol. */ -FIR_SWIFT_NAME(MessagingDelegate) +NS_SWIFT_NAME(MessagingDelegate) @protocol FIRMessagingDelegate <NSObject> @optional @@ -256,14 +245,14 @@ FIR_SWIFT_NAME(MessagingDelegate) /// * Subscribing to any topics. - (void)messaging:(nonnull FIRMessaging *)messaging didReceiveRegistrationToken:(nonnull NSString *)fcmToken - FIR_SWIFT_NAME(messaging(_:didReceiveRegistrationToken:)); + NS_SWIFT_NAME(messaging(_:didReceiveRegistrationToken:)); /// This method will be called whenever FCM receives a new, default FCM token for your /// Firebase project's Sender ID. This method is deprecated. Please use /// `messaging:didReceiveRegistrationToken:`. - (void)messaging:(nonnull FIRMessaging *)messaging didRefreshRegistrationToken:(nonnull NSString *)fcmToken - FIR_SWIFT_NAME(messaging(_:didRefreshRegistrationToken:)) + NS_SWIFT_NAME(messaging(_:didRefreshRegistrationToken:)) __deprecated_msg("Please use messaging:didReceiveRegistrationToken:, which is called for both \ current and refreshed tokens."); @@ -272,12 +261,12 @@ FIR_SWIFT_NAME(MessagingDelegate) /// UIApplicationDelegate's -application:didReceiveRemoteNotification: method. - (void)messaging:(nonnull FIRMessaging *)messaging didReceiveMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage - FIR_SWIFT_NAME(messaging(_:didReceive:)) + NS_SWIFT_NAME(messaging(_:didReceive:)) __IOS_AVAILABLE(10.0); /// The callback to handle data message received via FCM for devices running iOS 10 or above. - (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage - FIR_SWIFT_NAME(application(received:)) + NS_SWIFT_NAME(application(received:)) __deprecated_msg("Use FIRMessagingDelegate’s -messaging:didReceiveMessage:"); @end @@ -291,7 +280,7 @@ FIR_SWIFT_NAME(MessagingDelegate) * * In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`. */ -FIR_SWIFT_NAME(Messaging) +NS_SWIFT_NAME(Messaging) @interface FIRMessaging : NSObject /** @@ -325,7 +314,7 @@ FIR_SWIFT_NAME(Messaging) * * @return An instance of FIRMessaging. */ -+ (nonnull instancetype)messaging FIR_SWIFT_NAME(messaging()); ++ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging()); /** * Unavailable. Use +messaging instead. @@ -347,7 +336,7 @@ FIR_SWIFT_NAME(Messaging) * If you would like to set the type of the APNS token, rather than relying on * automatic detection, see: `-setAPNSToken:type:`. */ -@property(nonatomic, copy, nullable) NSData *APNSToken FIR_SWIFT_NAME(apnsToken); +@property(nonatomic, copy, nullable) NSData *APNSToken NS_SWIFT_NAME(apnsToken); /** * Set APNS token for the application. This APNS token will be used to register @@ -377,7 +366,7 @@ FIR_SWIFT_NAME(Messaging) * Once you have an FCM token, you should send it to your application server, so it can use * the FCM token to send notifications to your device. */ -@property(nonatomic, readonly, nullable) NSString *FCMToken FIR_SWIFT_NAME(fcmToken); +@property(nonatomic, readonly, nullable) NSString *FCMToken NS_SWIFT_NAME(fcmToken); /** @@ -398,7 +387,7 @@ FIR_SWIFT_NAME(Messaging) */ - (void)retrieveFCMTokenForSenderID:(nonnull NSString *)senderID completion:(nonnull FIRMessagingFCMTokenFetchCompletion)completion - FIR_SWIFT_NAME(retrieveFCMToken(forSenderID:completion:)); + NS_SWIFT_NAME(retrieveFCMToken(forSenderID:completion:)); /** @@ -410,7 +399,7 @@ FIR_SWIFT_NAME(Messaging) */ - (void)deleteFCMTokenForSenderID:(nonnull NSString *)senderID completion:(nonnull FIRMessagingDeleteFCMTokenCompletion)completion - FIR_SWIFT_NAME(deleteFCMToken(forSenderID:completion:)); + NS_SWIFT_NAME(deleteFCMToken(forSenderID:completion:)); #pragma mark - Connect @@ -428,7 +417,7 @@ FIR_SWIFT_NAME(Messaging) * establishing a connection and invoke the handler when successful. */ - (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler - FIR_SWIFT_NAME(connect(handler:)) + NS_SWIFT_NAME(connect(handler:)) __deprecated_msg("Please use the shouldEstablishDirectChannel property instead."); /** @@ -449,14 +438,14 @@ FIR_SWIFT_NAME(Messaging) * * @param topic The name of the topic, for example, @"sports". */ -- (void)subscribeToTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(subscribe(toTopic:)); +- (void)subscribeToTopic:(nonnull NSString *)topic NS_SWIFT_NAME(subscribe(toTopic:)); /** * Asynchronously unsubscribe from a topic. * * @param topic The name of the topic, for example @"sports". */ -- (void)unsubscribeFromTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(unsubscribe(fromTopic:)); +- (void)unsubscribeFromTopic:(nonnull NSString *)topic NS_SWIFT_NAME(unsubscribe(fromTopic:)); #pragma mark - Upstream diff --git a/Firebase/Storage/Public/FIRStorage.h b/Firebase/Storage/Public/FIRStorage.h index 112b1c6..f70b875 100644 --- a/Firebase/Storage/Public/FIRStorage.h +++ b/Firebase/Storage/Public/FIRStorage.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRStorageConstants.h" -#import "FIRStorageSwiftNameSupport.h" @class FIRApp; @class FIRStorageReference; @@ -38,28 +37,28 @@ FOUNDATION_EXPORT const unsigned char *const FIRStorageVersionString; * If you call [FIRStorage storageForApp:] and provide a custom instance of FIRApp, * the storage location will be specified via the FIROptions#storageBucket property. */ -FIR_SWIFT_NAME(Storage) +NS_SWIFT_NAME(Storage) @interface FIRStorage : NSObject /** * Creates an instance of FIRStorage, configured with the default FIRApp. * @return the FIRStorage instance, initialized with the default FIRApp. */ -+ (instancetype)storage FIR_SWIFT_NAME(storage()); ++ (instancetype)storage NS_SWIFT_NAME(storage()); /** * Creates an instance of FIRStorage, configured with the custom FIRApp @a app. * @param app The custom FIRApp used for initialization. * @return the FIRStorage instance, initialized with the custom FIRApp. */ -+ (instancetype)storageForApp:(FIRApp *)app FIR_SWIFT_NAME(storage(app:)); ++ (instancetype)storageForApp:(FIRApp *)app NS_SWIFT_NAME(storage(app:)); /** * Creates an instance of FIRStorage, configured with a custom storage bucket @a url. * @param url The gs:// url to your Firebase Storage Bucket. * @return the FIRStorage instance, initialized with the custom FIRApp. */ -+ (instancetype)storageWithURL:(NSString *)url FIR_SWIFT_NAME(storage(url:)); ++ (instancetype)storageWithURL:(NSString *)url NS_SWIFT_NAME(storage(url:)); /** * Creates an instance of FIRStorage, configured with a custom FIRApp @a app and a custom storage @@ -68,7 +67,7 @@ FIR_SWIFT_NAME(Storage) * @param url The gs:// url to your Firebase Storage Bucket. * @return the FIRStorage instance, initialized with the custom FIRApp. */ -+ (instancetype)storageForApp:(FIRApp *)app URL:(NSString *)url FIR_SWIFT_NAME(storage(app:url:)); ++ (instancetype)storageForApp:(FIRApp *)app URL:(NSString *)url NS_SWIFT_NAME(storage(app:url:)); /** * The Firebase App associated with this Firebase Storage instance. diff --git a/Firebase/Storage/Public/FIRStorageConstants.h b/Firebase/Storage/Public/FIRStorageConstants.h index cf6c3b8..be20135 100644 --- a/Firebase/Storage/Public/FIRStorageConstants.h +++ b/Firebase/Storage/Public/FIRStorageConstants.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRStorageSwiftNameSupport.h" - @class FIRStorageDownloadTask; @class FIRStorageMetadata; @class FIRStorageTaskSnapshot; @@ -28,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN /** * NSString typedef representing a task listener handle. */ -typedef NSString *FIRStorageHandle FIR_SWIFT_NAME(StorageHandle); +typedef NSString *FIRStorageHandle NS_SWIFT_NAME(StorageHandle); /** * Block typedef typically used when downloading data. @@ -36,21 +34,21 @@ typedef NSString *FIRStorageHandle FIR_SWIFT_NAME(StorageHandle); * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidDataError)(NSData *_Nullable data, NSError *_Nullable error) - FIR_SWIFT_NAME(StorageVoidDataError); + NS_SWIFT_NAME(StorageVoidDataError); /** * Block typedef typically used when performing "binary" async operations such as delete, * where the operation either succeeds without an error or fails with an error. * @param error The error describing failure, if one occurred. */ -typedef void (^FIRStorageVoidError)(NSError *_Nullable error) FIR_SWIFT_NAME(StorageVoidError); +typedef void (^FIRStorageVoidError)(NSError *_Nullable error) NS_SWIFT_NAME(StorageVoidError); /** * Block typedef typically used when retrieving metadata. * @param metadata The metadata returned by the operation, if metadata exists. */ typedef void (^FIRStorageVoidMetadata)(FIRStorageMetadata *_Nullable metadata) - FIR_SWIFT_NAME(StorageVoidMetadata); + NS_SWIFT_NAME(StorageVoidMetadata); /** * Block typedef typically used when retrieving metadata with the possibility of an error. @@ -59,14 +57,14 @@ typedef void (^FIRStorageVoidMetadata)(FIRStorageMetadata *_Nullable metadata) */ typedef void (^FIRStorageVoidMetadataError)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error) - FIR_SWIFT_NAME(StorageVoidMetadataError); + NS_SWIFT_NAME(StorageVoidMetadataError); /** * Block typedef typically used to asynchronously return a storage task snapshot. * @param snapshot The returned task snapshot. */ typedef void (^FIRStorageVoidSnapshot)(FIRStorageTaskSnapshot *snapshot) - FIR_SWIFT_NAME(StorageVoidSnapshot); + NS_SWIFT_NAME(StorageVoidSnapshot); /** * Block typedef typically used when retrieving a download URL. @@ -74,7 +72,7 @@ typedef void (^FIRStorageVoidSnapshot)(FIRStorageTaskSnapshot *snapshot) * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidURLError)(NSURL *_Nullable URL, NSError *_Nullable error) - FIR_SWIFT_NAME(StorageVoidURLError); + NS_SWIFT_NAME(StorageVoidURLError); /** * Enum representing the upload and download task status. @@ -109,12 +107,12 @@ typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) { * Task has failed and is unrecoverable. */ FIRStorageTaskStatusFailure -} FIR_SWIFT_NAME(StorageTaskStatus); +} NS_SWIFT_NAME(StorageTaskStatus); /** * Firebase Storage error domain. */ -FOUNDATION_EXPORT NSString *const FIRStorageErrorDomain FIR_SWIFT_NAME(StorageErrorDomain); +FOUNDATION_EXPORT NSString *const FIRStorageErrorDomain NS_SWIFT_NAME(StorageErrorDomain); /** * Enum representing the errors raised by Firebase Storage. @@ -168,6 +166,6 @@ typedef NS_ENUM(NSInteger, FIRStorageErrorCode) { /** User cancelled the operation. */ FIRStorageErrorCodeCancelled = -13040 -} FIR_SWIFT_NAME(StorageErrorCode); +} NS_SWIFT_NAME(StorageErrorCode); NS_ASSUME_NONNULL_END diff --git a/Firebase/Storage/Public/FIRStorageDownloadTask.h b/Firebase/Storage/Public/FIRStorageDownloadTask.h index f9d3e76..c11373f 100644 --- a/Firebase/Storage/Public/FIRStorageDownloadTask.h +++ b/Firebase/Storage/Public/FIRStorageDownloadTask.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRStorageObservableTask.h" -#import "FIRStorageSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -31,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN * specified callbackQueue in FIRStorage, or the main queue if left unspecified. * Currently all uploads must be initiated and managed on the main queue. */ -FIR_SWIFT_NAME(StorageDownloadTask) +NS_SWIFT_NAME(StorageDownloadTask) @interface FIRStorageDownloadTask : FIRStorageObservableTask <FIRStorageTaskManagement> @end diff --git a/Firebase/Storage/Public/FIRStorageMetadata.h b/Firebase/Storage/Public/FIRStorageMetadata.h index e6e001f..51f3547 100644 --- a/Firebase/Storage/Public/FIRStorageMetadata.h +++ b/Firebase/Storage/Public/FIRStorageMetadata.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRStorageSwiftNameSupport.h" - @class FIRStorageReference; NS_ASSUME_NONNULL_BEGIN @@ -29,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * Objects#resource docs. * @see https://cloud.google.com/storage/docs/json_api/v1/objects#resource */ -FIR_SWIFT_NAME(StorageMetadata) +NS_SWIFT_NAME(StorageMetadata) @interface FIRStorageMetadata : NSObject <NSCopying> /** diff --git a/Firebase/Storage/Public/FIRStorageObservableTask.h b/Firebase/Storage/Public/FIRStorageObservableTask.h index 502aba5..d8ad401 100644 --- a/Firebase/Storage/Public/FIRStorageObservableTask.h +++ b/Firebase/Storage/Public/FIRStorageObservableTask.h @@ -14,7 +14,6 @@ * limitations under the License. */ -#import "FIRStorageSwiftNameSupport.h" #import "FIRStorageTask.h" NS_ASSUME_NONNULL_BEGIN @@ -28,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * observers at a later date. * This class is currently not thread safe and can only be called on the main thread. */ -FIR_SWIFT_NAME(StorageObservableTask) +NS_SWIFT_NAME(StorageObservableTask) @interface FIRStorageObservableTask : FIRStorageTask /** diff --git a/Firebase/Storage/Public/FIRStorageReference.h b/Firebase/Storage/Public/FIRStorageReference.h index a85c738..a63c127 100644 --- a/Firebase/Storage/Public/FIRStorageReference.h +++ b/Firebase/Storage/Public/FIRStorageReference.h @@ -20,7 +20,6 @@ #import "FIRStorageConstants.h" #import "FIRStorageDownloadTask.h" #import "FIRStorageMetadata.h" -#import "FIRStorageSwiftNameSupport.h" #import "FIRStorageTask.h" #import "FIRStorageUploadTask.h" @@ -32,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN * path. * @see https://cloud.google.com/storage/ */ -FIR_SWIFT_NAME(StorageReference) +NS_SWIFT_NAME(StorageReference) @interface FIRStorageReference : NSObject /** @@ -100,7 +99,7 @@ FIR_SWIFT_NAME(StorageReference) * @param uploadData The NSData to upload. * @return An instance of FIRStorageUploadTask, which can be used to monitor or manage the upload. */ -- (FIRStorageUploadTask *)putData:(NSData *)uploadData FIR_SWIFT_NAME(putData(_:)); +- (FIRStorageUploadTask *)putData:(NSData *)uploadData NS_SWIFT_NAME(putData(_:)); /** * Asynchronously uploads data to the currently specified FIRStorageReference. @@ -113,7 +112,7 @@ FIR_SWIFT_NAME(StorageReference) // clang-format off - (FIRStorageUploadTask *)putData:(NSData *)uploadData metadata:(nullable FIRStorageMetadata *)metadata -FIR_SWIFT_NAME(putData(_:metadata:)); +NS_SWIFT_NAME(putData(_:metadata:)); // clang-format on /** @@ -131,7 +130,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); metadata:(nullable FIRStorageMetadata *)metadata completion:(nullable void (^)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error))completion - FIR_SWIFT_NAME(putData(_:metadata:completion:)); + NS_SWIFT_NAME(putData(_:metadata:completion:)); // clang-format on /** @@ -140,7 +139,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); * @param fileURL A URL representing the system file path of the object to be uploaded. * @return An instance of FIRStorageUploadTask, which can be used to monitor or manage the upload. */ -- (FIRStorageUploadTask *)putFile:(NSURL *)fileURL FIR_SWIFT_NAME(putFile(from:)); +- (FIRStorageUploadTask *)putFile:(NSURL *)fileURL NS_SWIFT_NAME(putFile(from:)); /** * Asynchronously uploads a file to the currently specified FIRStorageReference. @@ -152,7 +151,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); // clang-format off - (FIRStorageUploadTask *)putFile:(NSURL *)fileURL metadata:(nullable FIRStorageMetadata *)metadata - FIR_SWIFT_NAME(putFile(from:metadata:)); + NS_SWIFT_NAME(putFile(from:metadata:)); // clang-format on /** @@ -169,7 +168,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); metadata:(nullable FIRStorageMetadata *)metadata completion:(nullable void (^)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error))completion - FIR_SWIFT_NAME(putFile(from:metadata:completion:)); + NS_SWIFT_NAME(putFile(from:metadata:completion:)); // clang-format on #pragma mark - Downloads @@ -188,7 +187,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); - (FIRStorageDownloadTask *)dataWithMaxSize:(int64_t)size completion:(void (^)(NSData *_Nullable data, NSError *_Nullable error))completion - FIR_SWIFT_NAME(getData(maxSize:completion:)); + NS_SWIFT_NAME(getData(maxSize:completion:)); // clang-format on /** @@ -229,7 +228,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); */ - (void)metadataWithCompletion: (void (^)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error))completion - FIR_SWIFT_NAME(getMetadata(completion:)); + NS_SWIFT_NAME(getMetadata(completion:)); /** * Updates the metadata associated with an object at the current path. @@ -241,7 +240,7 @@ FIR_SWIFT_NAME(putData(_:metadata:)); - (void)updateMetadata:(FIRStorageMetadata *)metadata completion:(nullable void (^)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error))completion -FIR_SWIFT_NAME(updateMetadata(_:completion:)); +NS_SWIFT_NAME(updateMetadata(_:completion:)); // clang-format on #pragma mark - Delete diff --git a/Firebase/Storage/Public/FIRStorageSwiftNameSupport.h b/Firebase/Storage/Public/FIRStorageSwiftNameSupport.h deleted file mode 100644 index 216c047..0000000 --- a/Firebase/Storage/Public/FIRStorageSwiftNameSupport.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/Storage/Public/FIRStorageTask.h b/Firebase/Storage/Public/FIRStorageTask.h index b49363c..e889d5e 100644 --- a/Firebase/Storage/Public/FIRStorageTask.h +++ b/Firebase/Storage/Public/FIRStorageTask.h @@ -18,7 +18,6 @@ #import "FIRStorageConstants.h" #import "FIRStorageMetadata.h" -#import "FIRStorageSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * If no queue is specified by the developer, it defaults to the main queue. * Currently not thread safe, so only call methods on the main thread. */ -FIR_SWIFT_NAME(StorageTask) +NS_SWIFT_NAME(StorageTask) @interface FIRStorageTask : NSObject /** @@ -46,7 +45,7 @@ FIR_SWIFT_NAME(StorageTask) * implement pause, resume, and cancel, which operate on the task to pause, resume, and cancel * operations. */ -FIR_SWIFT_NAME(StorageTaskManagement) +NS_SWIFT_NAME(StorageTaskManagement) @protocol FIRStorageTaskManagement <NSObject> @required diff --git a/Firebase/Storage/Public/FIRStorageTaskSnapshot.h b/Firebase/Storage/Public/FIRStorageTaskSnapshot.h index b654c09..7d14202 100644 --- a/Firebase/Storage/Public/FIRStorageTaskSnapshot.h +++ b/Firebase/Storage/Public/FIRStorageTaskSnapshot.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRStorageConstants.h" -#import "FIRStorageSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * A Snapshot contains a task, storage reference, metadata (if it exists), * progress, and an error (if one occurred). */ -FIR_SWIFT_NAME(StorageTaskSnapshot) +NS_SWIFT_NAME(StorageTaskSnapshot) @interface FIRStorageTaskSnapshot : NSObject /** diff --git a/Firebase/Storage/Public/FIRStorageUploadTask.h b/Firebase/Storage/Public/FIRStorageUploadTask.h index cf9bde8..c753500 100644 --- a/Firebase/Storage/Public/FIRStorageUploadTask.h +++ b/Firebase/Storage/Public/FIRStorageUploadTask.h @@ -17,7 +17,6 @@ #import <Foundation/Foundation.h> #import "FIRStorageObservableTask.h" -#import "FIRStorageSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -31,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN * specified callbackQueue in FIRStorage, or the main queue if left unspecified. * Currently all uploads must be initiated and managed on the main queue. */ -FIR_SWIFT_NAME(StorageUploadTask) +NS_SWIFT_NAME(StorageUploadTask) @interface FIRStorageUploadTask : FIRStorageObservableTask <FIRStorageTaskManagement> @end |