From 5eef6929567157632c07248296d09e98cc6dc7ac Mon Sep 17 00:00:00 2001 From: Andriy Gordiychuk Date: Thu, 26 Apr 2018 02:02:59 +0300 Subject: [PATCH 1/2] Making some methods of FUIAuthBaseViewController public to make subclassing easier --- FirebaseAuthUI/FUIAuthBaseViewController.h | 38 +++++++++++++++++++ .../FUIAuthBaseViewController_Internal.h | 38 ------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/FirebaseAuthUI/FUIAuthBaseViewController.h b/FirebaseAuthUI/FUIAuthBaseViewController.h index af96faf9338..b25e582279a 100644 --- a/FirebaseAuthUI/FUIAuthBaseViewController.h +++ b/FirebaseAuthUI/FUIAuthBaseViewController.h @@ -27,6 +27,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface FUIAuthBaseViewController : UIViewController +/** @typedef FUIAuthAlertActionHandler + @brief The type of block called when an alert view is dismissed by a user action. + */ +typedef void (^FUIAuthAlertActionHandler)(void); + /** @property auth @brief The @c FIRAuth instance of the application. */ @@ -80,6 +85,39 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)cancelAuthorization; +/** @fn showSignInAlertWithEmail:provider:handler: + @brief Displays an alert to conform with user whether she wants to proceed with the provider. + @param email The email address to sign in with. + @param provider The identity provider to sign in with. + @param signinHandler Handler for the sign in action of the alert. + @param cancelHandler Handler for the cancel action of the alert. + */ ++ (void)showSignInAlertWithEmail:(NSString *)email + provider:(id)provider + presentingViewController:(UIViewController *)presentingViewController + signinHandler:(FUIAuthAlertActionHandler)signinHandler + cancelHandler:(FUIAuthAlertActionHandler)cancelHandler; + +/** @fn incrementActivity + @brief Increment the current activity count. If there's positive number of activities, display + and animate the activity indicator with a short period of delay. + @remarks Calls to @c incrementActivity and @c decrementActivity should be balanced. + */ +- (void)incrementActivity; + +/** @fn decrementActivity + @brief Decrement the current activity count. If the count reaches 0, stop and hide the + activity indicator. + @remarks Calls to @c incrementActivity and @c decrementActivity should be balanced. + */ +- (void)decrementActivity; + +/** @fn addActivityIndicator: + @brief Creates and add activity indicator to the center of the specified view. + @param view The View where indicator is shown. + */ ++ (UIActivityIndicatorView *)addActivityIndicator:(UIView *)view; + @end NS_ASSUME_NONNULL_END diff --git a/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h b/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h index 308d21a4d3a..c1f6cbb0c0e 100644 --- a/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h +++ b/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h @@ -20,11 +20,6 @@ NS_ASSUME_NONNULL_BEGIN @interface FUIAuthBaseViewController (Internal) -/** @typedef FUIAuthAlertActionHandler - @brief The type of block called when an alert view is dismissed by a user action. - */ -typedef void (^FUIAuthAlertActionHandler)(void); - /** @fn isValidEmail: @brief Statically validates email address. @param email The email address to validate. @@ -61,19 +56,6 @@ typedef void (^FUIAuthAlertActionHandler)(void); actionTitle:(NSString *)actionTitle presentingViewController:(UIViewController *)presentingViewController; -/** @fn showSignInAlertWithEmail:provider:handler: - @brief Displays an alert to conform with user whether she wants to proceed with the provider. - @param email The email address to sign in with. - @param provider The identity provider to sign in with. - @param signinHandler Handler for the sign in action of the alert. - @param cancelHandler Handler for the cancel action of the alert. - */ -+ (void)showSignInAlertWithEmail:(NSString *)email - provider:(id)provider - presentingViewController:(UIViewController *)presentingViewController - signinHandler:(FUIAuthAlertActionHandler)signinHandler - cancelHandler:(FUIAuthAlertActionHandler)cancelHandler; - /** @fn pushViewController: @brief Push the view controller to the navigation controller of the current view controller with animation. The pushed view controller will have a fixed "Back" title for back button. @@ -90,31 +72,11 @@ typedef void (^FUIAuthAlertActionHandler)(void); + (void)pushViewController:(UIViewController *)viewController navigationController:(UINavigationController *)navigationController; -/** @fn incrementActivity - @brief Increment the current activity count. If there's positive number of activities, display - and animate the activity indicator with a short period of delay. - @remarks Calls to @c incrementActivity and @c decrementActivity should be balanced. - */ -- (void)incrementActivity; - -/** @fn decrementActivity - @brief Decrement the current activity count. If the count reaches 0, stop and hide the - activity indicator. - @remarks Calls to @c incrementActivity and @c decrementActivity should be balanced. - */ -- (void)decrementActivity; - /** @fn providerLocalizedName: @brief Maps provider Id to localized provider name. */ + (NSString *)providerLocalizedName:(NSString *)providerId; -/** @fn addActivityIndicator: - @brief Creates and add activity indicator to the center of the specified view. - @param view The View where indicator is shown. - */ -+ (UIActivityIndicatorView *)addActivityIndicator:(UIView *)view; - /** @fn barItemWithTitle:target:action: @brief Creates multiline @c UIBarButtonItem of fixed width. @param title The title of the button. From e85845219f883f4c8ffc771171337b0dfdc0173b Mon Sep 17 00:00:00 2001 From: Andriy Gordiychuk Date: Thu, 3 May 2018 19:36:36 +0300 Subject: [PATCH 2/2] Added comment changes --- FirebaseAuthUI/FUIAuthBaseViewController.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FirebaseAuthUI/FUIAuthBaseViewController.h b/FirebaseAuthUI/FUIAuthBaseViewController.h index b25e582279a..e4e08434366 100644 --- a/FirebaseAuthUI/FUIAuthBaseViewController.h +++ b/FirebaseAuthUI/FUIAuthBaseViewController.h @@ -86,7 +86,7 @@ typedef void (^FUIAuthAlertActionHandler)(void); - (void)cancelAuthorization; /** @fn showSignInAlertWithEmail:provider:handler: - @brief Displays an alert to conform with user whether she wants to proceed with the provider. + @brief Displays an alert asking the user to confirm whether or not they want to proceed with the selected provider. @param email The email address to sign in with. @param provider The identity provider to sign in with. @param signinHandler Handler for the sign in action of the alert. @@ -100,7 +100,7 @@ typedef void (^FUIAuthAlertActionHandler)(void); /** @fn incrementActivity @brief Increment the current activity count. If there's positive number of activities, display - and animate the activity indicator with a short period of delay. + and animate the activity indicator with a short delay. @remarks Calls to @c incrementActivity and @c decrementActivity should be balanced. */ - (void)incrementActivity; @@ -113,8 +113,8 @@ typedef void (^FUIAuthAlertActionHandler)(void); - (void)decrementActivity; /** @fn addActivityIndicator: - @brief Creates and add activity indicator to the center of the specified view. - @param view The View where indicator is shown. + @briefCreates and adds an activity indicator to the center of the specified view. + @param view The view where indicator is shown. */ + (UIActivityIndicatorView *)addActivityIndicator:(UIView *)view;