Skip to content

Commit 4229048

Browse files
authored
Merge pull request #437 from AndriyGo/master
Making some methods of FUIAuthBaseViewController public to make subclassing easier
2 parents 74cfe87 + e858452 commit 4229048

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

FirebaseAuthUI/FUIAuthBaseViewController.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ NS_ASSUME_NONNULL_BEGIN
2727
*/
2828
@interface FUIAuthBaseViewController : UIViewController
2929

30+
/** @typedef FUIAuthAlertActionHandler
31+
@brief The type of block called when an alert view is dismissed by a user action.
32+
*/
33+
typedef void (^FUIAuthAlertActionHandler)(void);
34+
3035
/** @property auth
3136
@brief The @c FIRAuth instance of the application.
3237
*/
@@ -80,6 +85,39 @@ NS_ASSUME_NONNULL_BEGIN
8085
*/
8186
- (void)cancelAuthorization;
8287

88+
/** @fn showSignInAlertWithEmail:provider:handler:
89+
@brief Displays an alert asking the user to confirm whether or not they want to proceed with the selected provider.
90+
@param email The email address to sign in with.
91+
@param provider The identity provider to sign in with.
92+
@param signinHandler Handler for the sign in action of the alert.
93+
@param cancelHandler Handler for the cancel action of the alert.
94+
*/
95+
+ (void)showSignInAlertWithEmail:(NSString *)email
96+
provider:(id<FUIAuthProvider>)provider
97+
presentingViewController:(UIViewController *)presentingViewController
98+
signinHandler:(FUIAuthAlertActionHandler)signinHandler
99+
cancelHandler:(FUIAuthAlertActionHandler)cancelHandler;
100+
101+
/** @fn incrementActivity
102+
@brief Increment the current activity count. If there's positive number of activities, display
103+
and animate the activity indicator with a short delay.
104+
@remarks Calls to @c incrementActivity and @c decrementActivity should be balanced.
105+
*/
106+
- (void)incrementActivity;
107+
108+
/** @fn decrementActivity
109+
@brief Decrement the current activity count. If the count reaches 0, stop and hide the
110+
activity indicator.
111+
@remarks Calls to @c incrementActivity and @c decrementActivity should be balanced.
112+
*/
113+
- (void)decrementActivity;
114+
115+
/** @fn addActivityIndicator:
116+
@briefCreates and adds an activity indicator to the center of the specified view.
117+
@param view The view where indicator is shown.
118+
*/
119+
+ (UIActivityIndicatorView *)addActivityIndicator:(UIView *)view;
120+
83121
@end
84122

85123
NS_ASSUME_NONNULL_END

FirebaseAuthUI/FUIAuthBaseViewController_Internal.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ NS_ASSUME_NONNULL_BEGIN
2020

2121
@interface FUIAuthBaseViewController (Internal)
2222

23-
/** @typedef FUIAuthAlertActionHandler
24-
@brief The type of block called when an alert view is dismissed by a user action.
25-
*/
26-
typedef void (^FUIAuthAlertActionHandler)(void);
27-
2823
/** @fn isValidEmail:
2924
@brief Statically validates email address.
3025
@param email The email address to validate.
@@ -61,19 +56,6 @@ typedef void (^FUIAuthAlertActionHandler)(void);
6156
actionTitle:(NSString *)actionTitle
6257
presentingViewController:(UIViewController *)presentingViewController;
6358

64-
/** @fn showSignInAlertWithEmail:provider:handler:
65-
@brief Displays an alert to conform with user whether she wants to proceed with the provider.
66-
@param email The email address to sign in with.
67-
@param provider The identity provider to sign in with.
68-
@param signinHandler Handler for the sign in action of the alert.
69-
@param cancelHandler Handler for the cancel action of the alert.
70-
*/
71-
+ (void)showSignInAlertWithEmail:(NSString *)email
72-
provider:(id<FUIAuthProvider>)provider
73-
presentingViewController:(UIViewController *)presentingViewController
74-
signinHandler:(FUIAuthAlertActionHandler)signinHandler
75-
cancelHandler:(FUIAuthAlertActionHandler)cancelHandler;
76-
7759
/** @fn pushViewController:
7860
@brief Push the view controller to the navigation controller of the current view controller
7961
with animation. The pushed view controller will have a fixed "Back" title for back button.
@@ -90,31 +72,11 @@ typedef void (^FUIAuthAlertActionHandler)(void);
9072
+ (void)pushViewController:(UIViewController *)viewController
9173
navigationController:(UINavigationController *)navigationController;
9274

93-
/** @fn incrementActivity
94-
@brief Increment the current activity count. If there's positive number of activities, display
95-
and animate the activity indicator with a short period of delay.
96-
@remarks Calls to @c incrementActivity and @c decrementActivity should be balanced.
97-
*/
98-
- (void)incrementActivity;
99-
100-
/** @fn decrementActivity
101-
@brief Decrement the current activity count. If the count reaches 0, stop and hide the
102-
activity indicator.
103-
@remarks Calls to @c incrementActivity and @c decrementActivity should be balanced.
104-
*/
105-
- (void)decrementActivity;
106-
10775
/** @fn providerLocalizedName:
10876
@brief Maps provider Id to localized provider name.
10977
*/
11078
+ (NSString *)providerLocalizedName:(NSString *)providerId;
11179

112-
/** @fn addActivityIndicator:
113-
@brief Creates and add activity indicator to the center of the specified view.
114-
@param view The View where indicator is shown.
115-
*/
116-
+ (UIActivityIndicatorView *)addActivityIndicator:(UIView *)view;
117-
11880
/** @fn barItemWithTitle:target:action:
11981
@brief Creates multiline @c UIBarButtonItem of fixed width.
12082
@param title The title of the button.

0 commit comments

Comments
 (0)