Skip to content

Commit 53c2a0b

Browse files
committed
refactor FirebaseUI Auth class names
1 parent f1d27d2 commit 53c2a0b

File tree

86 files changed

+1788
-807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1788
-807
lines changed

FirebaseAuthUI/FIRAuthUI.h renamed to FirebaseAuthUI/FUIAuth.h

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,130 +16,130 @@
1616

1717
#import <UIKit/UIKit.h>
1818

19-
#import "FIRAuthProviderUI.h"
19+
#import "FUIAuthProvider.h"
2020

2121
@class FIRAuth;
22-
@class FIRAuthPickerViewController;
23-
@class FIRAuthUI;
22+
@class FUIAuthPickerViewController;
23+
@class FUIAuth;
2424
@class FIRUser;
25-
@class FIREmailEntryViewController;
26-
@class FIRPasswordSignInViewController;
27-
@class FIRPasswordSignUpViewController;
28-
@class FIRPasswordRecoveryViewController;
29-
@class FIRPasswordVerificationViewController;
25+
@class FUIEmailEntryViewController;
26+
@class FUIPasswordSignInViewController;
27+
@class FUIPasswordSignUpViewController;
28+
@class FUIPasswordRecoveryViewController;
29+
@class FUIPasswordVerificationViewController;
3030

3131
NS_ASSUME_NONNULL_BEGIN
3232

33-
/** @typedef FIRAuthUIResultCallback
33+
/** @typedef FUIAuthResultCallback
3434
@brief The type of block invoked when sign-in related events complete.
3535
@param user The user signed in, if any.
3636
@param error The error which occurred, if any.
3737
*/
38-
typedef void (^FIRAuthUIResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error);
38+
typedef void (^FUIAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error);
3939

40-
/** @protocol FIRAuthUIDelegate
41-
@brief A delegate that receives callbacks or provides custom UI for @c FIRAuthUI.
40+
/** @protocol FUIAuthDelegate
41+
@brief A delegate that receives callbacks or provides custom UI for @c FUIAuth.
4242
*/
43-
@protocol FIRAuthUIDelegate <NSObject>
43+
@protocol FUIAuthDelegate <NSObject>
4444

4545
/** @fn authUI:didSignInWithUser:error:
4646
@brief Message sent after the sign in process has completed to report the signed in user or
4747
error encountered.
48-
@param authUI The @c FIRAuthUI instance sending the messsage.
48+
@param authUI The @c FUIAuth instance sending the messsage.
4949
@param user The signed in user if the sign in attempt was successful.
5050
@param error The error that occured during sign in, if any.
5151
*/
52-
- (void)authUI:(FIRAuthUI *)authUI didSignInWithUser:(nullable FIRUser *)user error:(nullable NSError *)error;
52+
- (void)authUI:(FUIAuth *)authUI didSignInWithUser:(nullable FIRUser *)user error:(nullable NSError *)error;
5353

5454
@optional
5555

5656
/** @fn authPickerViewControllerForAuthUI:
57-
@brief Sent to the receiver to ask for an instance of @c FIRAuthPickerViewController subclass
57+
@brief Sent to the receiver to ask for an instance of @c FUIAuthPickerViewController subclass
5858
to allow UI customizations.
59-
@param authUI The @c FIRAuthUI instance sending the message.
60-
@return an instance of @c FIRAuthPickerViewController subclass.
59+
@param authUI The @c FUIAuth instance sending the message.
60+
@return an instance of @c FUIAuthPickerViewController subclass.
6161
*/
62-
- (FIRAuthPickerViewController *)authPickerViewControllerForAuthUI:(FIRAuthUI *)authUI;
62+
- (FUIAuthPickerViewController *)authPickerViewControllerForAuthUI:(FUIAuth *)authUI;
6363

6464
/** @fn emailEntryViewControllerForAuthUI:
65-
@brief Sent to the receiver to ask for an instance of @c FIREmailEntryViewController subclass
65+
@brief Sent to the receiver to ask for an instance of @c FUIEmailEntryViewController subclass
6666
to allow UI customizations.
67-
@param authUI The @c FIRAuthUI instance sending the message.
68-
@return an instance of @c FIREmailEntryViewController subclass.
67+
@param authUI The @c FUIAuth instance sending the message.
68+
@return an instance of @c FUIEmailEntryViewController subclass.
6969
*/
70-
- (FIREmailEntryViewController *)emailEntryViewControllerForAuthUI:(FIRAuthUI *)authUI;
70+
- (FUIEmailEntryViewController *)emailEntryViewControllerForAuthUI:(FUIAuth *)authUI;
7171

7272
/** @fn passwordSignInViewControllerForAuthUI:email:
73-
@brief Sent to the receiver to ask for an instance of @c FIRPasswordSignInViewController subclass
73+
@brief Sent to the receiver to ask for an instance of @c FUIPasswordSignInViewController subclass
7474
to allow sign-in UI customizations.
75-
@param authUI The @c FIRAuthUI instance sending the message.
75+
@param authUI The @c FUIAuth instance sending the message.
7676
@param email The email user is using for sin-in.
77-
@return an instance of @c FIRPasswordSignInViewController subclass.
77+
@return an instance of @c FUIPasswordSignInViewController subclass.
7878
*/
79-
- (FIRPasswordSignInViewController *)passwordSignInViewControllerForAuthUI:(FIRAuthUI *)authUI
79+
- (FUIPasswordSignInViewController *)passwordSignInViewControllerForAuthUI:(FUIAuth *)authUI
8080
email:(NSString *)email;
8181

8282
/** @fn passwordSignInViewControllerForAuthUI:email:
83-
@brief Sent to the receiver to ask for an instance of @c FIRPasswordSignUpViewController subclass
83+
@brief Sent to the receiver to ask for an instance of @c FUIPasswordSignUpViewController subclass
8484
to allow sign-up UI customizations.
85-
@param authUI The @c FIRAuthUI instance sending the message.
85+
@param authUI The @c FUIAuth instance sending the message.
8686
@param email The email user is using for sin-in.
87-
@return an instance of @c FIRPasswordSignUpViewController subclass.
87+
@return an instance of @c FUIPasswordSignUpViewController subclass.
8888
*/
89-
- (FIRPasswordSignUpViewController *)passwordSignUpViewControllerForAuthUI:(FIRAuthUI *)authUI
89+
- (FUIPasswordSignUpViewController *)passwordSignUpViewControllerForAuthUI:(FUIAuth *)authUI
9090
email:(NSString *)email;
9191

9292
/** @fn passwordRecoveryViewControllerForAuthUI:email:
93-
@brief Sent to the receiver to ask for an instance of @c FIRPasswordRecoveryViewController subclass
93+
@brief Sent to the receiver to ask for an instance of @c FUIPasswordRecoveryViewController subclass
9494
to allow sign-up UI customizations.
95-
@param authUI The @c FIRAuthUI instance sending the message.
95+
@param authUI The @c FUIAuth instance sending the message.
9696
@param email The email user is using for password recovery.
97-
@return an instance of @c FIRPasswordRecoveryViewController subclass.
97+
@return an instance of @c FUIPasswordRecoveryViewController subclass.
9898
*/
99-
- (FIRPasswordRecoveryViewController *)passwordRecoveryViewControllerForAuthUI:(FIRAuthUI *)authUI
99+
- (FUIPasswordRecoveryViewController *)passwordRecoveryViewControllerForAuthUI:(FUIAuth *)authUI
100100
email:(NSString *)email;
101101

102102
/** @fn passwordVerificationViewControllerForAuthUI:email:newCredential:
103-
@brief Sent to the receiver to ask for an instance of @c FIRPasswordVerificationViewController subclass
103+
@brief Sent to the receiver to ask for an instance of @c FUIPasswordVerificationViewController subclass
104104
to allow password verification UI customizations.
105-
@param authUI The @c FIRAuthUI instance sending the message.
105+
@param authUI The @c FUIAuth instance sending the message.
106106
@param email The email user is using for sin-in.
107107
@param newCredential This @c FIRAuthCredential obtained from linked account.
108-
@return an instance of @c FIRPasswordVerificationViewController subclass.
108+
@return an instance of @c FUIPasswordVerificationViewController subclass.
109109
*/
110-
- (FIRPasswordVerificationViewController *)passwordVerificationViewControllerForAuthUI:(FIRAuthUI *)authUI
110+
- (FUIPasswordVerificationViewController *)passwordVerificationViewControllerForAuthUI:(FUIAuth *)authUI
111111
email:(NSString *)email
112112
newCredential:(FIRAuthCredential *)newCredential;
113113
@end
114114

115-
/** @class FIRAuthUI
115+
/** @class FUIAuth
116116
@brief Provides various iOS UIs for Firebase Auth.
117117
*/
118-
@interface FIRAuthUI : NSObject <NSSecureCoding>
118+
@interface FUIAuth : NSObject <NSSecureCoding>
119119

120120
/** @fn defaultAuthUI
121-
@brief Gets the @c FIRAuthUI object for the default FirebaseApp.
121+
@brief Gets the @c FUIAuth object for the default FirebaseApp.
122122
@remarks Thread safe.
123123
*/
124-
+ (nullable FIRAuthUI *)defaultAuthUI;
124+
+ (nullable FUIAuth *)defaultAuthUI;
125125

126126
/** @fn authUIWithAuth:
127-
@brief Gets the @c FIRAuthUI instance for a @c FIRAuth.
128-
@param auth The @c FIRAuth for which to retrieve the associated @c FIRAuthUI instance.
129-
@return The @c FIRAuthUI instance associated with the given @c FIRAuth.
127+
@brief Gets the @c FUIAuth instance for a @c FIRAuth.
128+
@param auth The @c FIRAuth for which to retrieve the associated @c FUIAuth instance.
129+
@return The @c FUIAuth instance associated with the given @c FIRAuth.
130130
@remarks Thread safe.
131131
*/
132-
+ (nullable FIRAuthUI *)authUIWithAuth:(FIRAuth *)auth;
132+
+ (nullable FUIAuth *)authUIWithAuth:(FIRAuth *)auth;
133133

134134
/** @property app
135135
@brief Gets the @c FIRAuth this auth UI object is connected to.
136136
*/
137137
@property(nonatomic, weak, readonly, nullable) FIRAuth *auth;
138138

139139
/** @property providers
140-
@brief The @c FIRAuthProviderUI implementations to use for sign-in.
140+
@brief The @c FUIAuthProvider implementations to use for sign-in.
141141
*/
142-
@property(nonatomic, copy) NSArray<id<FIRAuthProviderUI>> *providers;
142+
@property(nonatomic, copy) NSArray<id<FUIAuthProvider>> *providers;
143143

144144
/** @property signInWithEmailHidden
145145
@brief Whether to hide the "Sign in with email" option, defaults to NO.
@@ -161,12 +161,12 @@ typedef void (^FIRAuthUIResultCallback)(FIRUser *_Nullable user, NSError *_Nulla
161161
@property(nonatomic, copy, nullable) NSURL *TOSURL;
162162

163163
/** @property delegate
164-
@brief A delegate that receives callbacks or provides custom UI for @c FIRAuthUI.
164+
@brief A delegate that receives callbacks or provides custom UI for @c FUIAuth.
165165
*/
166-
@property(nonatomic, weak) id<FIRAuthUIDelegate> delegate;
166+
@property(nonatomic, weak) id<FUIAuthDelegate> delegate;
167167

168168
/** @fn init
169-
@brief Please use @c FIRAuthUI.authUIWithAuth to get a @c FIRAuthUI instance.
169+
@brief Please use @c FUIAuth.authUIWithAuth to get a @c FUIAuth instance.
170170
*/
171171
- (nullable instancetype)init NS_UNAVAILABLE;
172172

FirebaseAuthUI/FIRAuthUI.m renamed to FirebaseAuthUI/FUIAuth.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,53 +14,53 @@
1414
// limitations under the License.
1515
//
1616

17-
#import "FIRAuthUI.h"
17+
#import "FUIAuth.h"
1818

1919
#import <objc/runtime.h>
2020

2121
#import <FirebaseAnalytics/FIRApp.h>
2222
#import <FirebaseAuth/FIRAuth.h>
23-
#import "FIRAuthPickerViewController.h"
24-
#import "FIRAuthUI_Internal.h"
25-
#import "FIREmailEntryViewController.h"
23+
#import "FUIAuthPickerViewController.h"
24+
#import "FUIAuth_Internal.h"
25+
#import "FUIEmailEntryViewController.h"
2626

2727
/** @var kAppNameCodingKey
2828
@brief The key used to encode the app Name for NSCoding.
2929
*/
3030
static NSString *const kAppNameCodingKey = @"appName";
3131

3232
/** @var kAuthAssociationKey
33-
@brief The address of this variable is used as the key for associating FIRAuthUI instances with
33+
@brief The address of this variable is used as the key for associating FUIAuth instances with
3434
root FIRAuth objects.
3535
*/
3636
static const char kAuthAssociationKey;
3737

38-
@interface FIRAuthUI ()
38+
@interface FUIAuth ()
3939

4040
/** @fn initWithAuth:
41-
@brief auth The @c FIRAuth to associate the @c FIRAuthUI instance with.
41+
@brief auth The @c FIRAuth to associate the @c FUIAuth instance with.
4242
*/
4343
- (nullable instancetype)initWithAuth:(FIRAuth *)auth NS_DESIGNATED_INITIALIZER;
4444

4545
@end
4646

47-
@implementation FIRAuthUI
47+
@implementation FUIAuth
4848

49-
+ (nullable FIRAuthUI *)defaultAuthUI {
49+
+ (nullable FUIAuth *)defaultAuthUI {
5050
FIRAuth *defaultAuth = [FIRAuth auth];
5151
if (!defaultAuth) {
5252
return nil;
5353
}
5454
return [self authUIWithAuth:defaultAuth];
5555
}
5656

57-
+ (nullable FIRAuthUI *)authUIWithAuth:(FIRAuth *)auth {
57+
+ (nullable FUIAuth *)authUIWithAuth:(FIRAuth *)auth {
5858
NSParameterAssert(auth != nil);
5959
@synchronized (self) {
60-
// Let the FIRAuth instance retain the FIRAuthUI instance.
61-
FIRAuthUI *authUI = objc_getAssociatedObject(auth, &kAuthAssociationKey);
60+
// Let the FIRAuth instance retain the FUIAuth instance.
61+
FUIAuth *authUI = objc_getAssociatedObject(auth, &kAuthAssociationKey);
6262
if (!authUI) {
63-
authUI = [[FIRAuthUI alloc] initWithAuth:auth];
63+
authUI = [[FUIAuth alloc] initWithAuth:auth];
6464
objc_setAssociatedObject(auth, &kAuthAssociationKey, authUI,
6565
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
6666
}
@@ -79,7 +79,7 @@ - (instancetype)initWithAuth:(FIRAuth *)auth {
7979
- (BOOL)handleOpenURL:(NSURL *)URL
8080
sourceApplication:(NSString *)sourceApplication {
8181
// Complete IDP-based sign-in flow.
82-
for (id<FIRAuthProviderUI> provider in _providers) {
82+
for (id<FUIAuthProvider> provider in _providers) {
8383
if ([provider handleOpenURL:URL sourceApplication:sourceApplication]) {
8484
return YES;
8585
}
@@ -95,12 +95,12 @@ - (UINavigationController *)authViewController {
9595
if ([self.delegate respondsToSelector:@selector(emailEntryViewControllerForAuthUI:)]) {
9696
controller = [self.delegate emailEntryViewControllerForAuthUI:self];
9797
} else {
98-
controller = [[FIREmailEntryViewController alloc] initWithAuthUI:self];
98+
controller = [[FUIEmailEntryViewController alloc] initWithAuthUI:self];
9999
}
100100
} else if ([self.delegate respondsToSelector:@selector(authPickerViewControllerForAuthUI:)]) {
101101
controller = [self.delegate authPickerViewControllerForAuthUI:self];
102102
} else {
103-
controller = [[FIRAuthPickerViewController alloc] initWithAuthUI:self];
103+
controller = [[FUIAuthPickerViewController alloc] initWithAuthUI:self];
104104
}
105105
return [[UINavigationController alloc] initWithRootViewController:controller];
106106
}
@@ -110,7 +110,7 @@ - (BOOL)signOutWithError:(NSError *_Nullable *_Nullable)error {
110110
BOOL success = [self.auth signOut:error];
111111
if (success) {
112112
// sign out from all providers (wipes provider tokens too)
113-
for (id<FIRAuthProviderUI> provider in _providers) {
113+
for (id<FUIAuthProvider> provider in _providers) {
114114
[provider signOut];
115115
}
116116
}

FirebaseAuthUI/FIRAuthUIBaseViewController.h renamed to FirebaseAuthUI/FUIAuthBaseViewController.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717
#import <UIKit/UIKit.h>
1818

1919
@class FIRAuth;
20-
@class FIRAuthUI;
21-
@protocol FIRAuthProviderUI;
20+
@class FUIAuth;
21+
@protocol FUIAuthProvider;
2222

2323
NS_ASSUME_NONNULL_BEGIN
2424

25-
/** @typedef FIRAuthUIAlertActionHandler
25+
/** @typedef FUIAuthAlertActionHandler
2626
@brief The type of block called when an alert view is dismissed by a user action.
2727
*/
28-
typedef void (^FIRAuthUIAlertActionHandler)(void);
28+
typedef void (^FUIAuthAlertActionHandler)(void);
2929

30-
/** @class FIRAuthUIBaseViewController
30+
/** @class FUIAuthBaseViewController
3131
@brief The base view controller that provides common methods for all subclasses.
3232
*/
33-
@interface FIRAuthUIBaseViewController : UIViewController
33+
@interface FUIAuthBaseViewController : UIViewController
3434

3535
/** @property auth
3636
@brief The @c FIRAuth instance of the application.
3737
*/
3838
@property(nonatomic, strong, readonly) FIRAuth *auth;
3939

4040
/** @property authUI
41-
@brief The @c FIRAuth instance of the application.
41+
@brief The @c FUIAuth instance of the application.
4242
*/
43-
@property(nonatomic, strong, readonly) FIRAuthUI *authUI;
43+
@property(nonatomic, strong, readonly) FUIAuth *authUI;
4444

4545
/** @fn init
4646
@brief Please use @c initWithNibName:bundle:authUI:.
@@ -62,17 +62,17 @@ typedef void (^FIRAuthUIAlertActionHandler)(void);
6262
@brief Designated initializer.
6363
@param nibNameOrNil The name of the nib file to associate with the view controller.
6464
@param nibBundleOrNil The bundle in which to search for the nib file.
65-
@param authUI The @c FIRAuthUI instance that manages this view controller.
65+
@param authUI The @c FUIAuth instance that manages this view controller.
6666
*/
6767
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
6868
bundle:(nullable NSBundle *)nibBundleOrNil
69-
authUI:(FIRAuthUI *)authUI NS_DESIGNATED_INITIALIZER;
69+
authUI:(FUIAuth *)authUI NS_DESIGNATED_INITIALIZER;
7070

7171
/** @fn initWithAuthUI:
7272
@brief Convenience initializer.
73-
@param authUI The @c FIRAuthUI instance that manages this view controller.
73+
@param authUI The @c FUIAuth instance that manages this view controller.
7474
*/
75-
- (instancetype)initWithAuthUI:(FIRAuthUI *)authUI;
75+
- (instancetype)initWithAuthUI:(FUIAuth *)authUI;
7676

7777
/** @fn isValidEmail:
7878
@brief Statically validates email address.
@@ -94,8 +94,8 @@ typedef void (^FIRAuthUIAlertActionHandler)(void);
9494
@param handler Handler for the sign in action of the alert.
9595
*/
9696
- (void)showSignInAlertWithEmail:(NSString *)email
97-
provider:(id<FIRAuthProviderUI>)provider
98-
handler:(FIRAuthUIAlertActionHandler)handler;
97+
provider:(id<FUIAuthProvider>)provider
98+
handler:(FUIAuthAlertActionHandler)handler;
9999

100100
/** @fn pushViewController:
101101
@brief Push the view controller to the navigation controller of the current view controller

0 commit comments

Comments
 (0)