Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate interactive dismissal and cancel button customization #792

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Auth/FirebaseAuthUI/FUIAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ __attribute__((deprecated("Instead use authUI:didSignInWithAuthDataResult:error:
@property(nonatomic, copy) NSArray<id<FUIAuthProvider>> *providers;

/** @property shouldHideCancelButton
@brief Whether to hide the cancel button, defaults to NO. On iOS 13, this also disables
the swipe-to-dismiss gesture.
@brief Whether to hide the cancel button, defaults to NO.
*/
@property(nonatomic, assign) BOOL shouldHideCancelButton;

/** @property interactiveDismissEnabled
@brief Whether or not interactive dismiss should be enabled on iOS 13 and above devices.
*/
@property(nonatomic, assign, getter=isInteractiveDismissEnabled) BOOL interactiveDismissEnabled API_AVAILABLE(ios(13));

/** @property customStringsBundle
@brief Custom strings bundle supplied by the developer. Nil when there is no custom strings
bundle set. In which case the default bundle will be used.
Expand Down
3 changes: 2 additions & 1 deletion Auth/FirebaseAuthUI/FUIAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ - (instancetype)initWithAuth:(FIRAuth *)auth {
self = [super init];
if (self) {
_auth = auth;
_interactiveDismissEnabled = YES;
}
return self;
}
Expand Down Expand Up @@ -178,7 +179,7 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
if (self.auth.currentUser.isAnonymous && !credential) {
if (result) {
result(self.auth.currentUser, nil);
};
}
// Hide Auth Picker Controller which was presented modally.
if (isAuthPickerShown && presentingViewController.presentingViewController) {
[presentingViewController dismissViewControllerAnimated:YES completion:nil];
Expand Down
6 changes: 4 additions & 2 deletions Auth/FirebaseAuthUI/FUIAuthPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ - (void)viewDidLoad {
target:self
action:@selector(cancelAuthorization)];
self.navigationItem.leftBarButtonItem = cancelBarButton;
} else {
if (@available(iOS 13, *)) {
}
if (@available(iOS 13, *)) {
if (!self.authUI.interactiveDismissEnabled) {
self.modalInPresentation = YES;
}
}

self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:FUILocalizedString(kStr_Back)
style:UIBarButtonItemStylePlain
Expand Down
6 changes: 6 additions & 0 deletions EmailAuth/FirebaseEmailAuthUI/FUIConfirmEmailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ - (void)viewWillAppear:(BOOL)animated {
style:UIBarButtonItemStylePlain
target:nil
action:nil];

if (@available(iOS 13, *)) {
if (!self.authUI.isInteractiveDismissEnabled) {
self.modalInPresentation = YES;
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUIEmailAuth : NSObject <FUIAuthProvider>

/** @property emailLink.
@brief The link for email link sign in.
@brief The link for email link sign in.
*/
@property(nonatomic, strong, readwrite, nullable) NSString *emailLink;

Expand Down
6 changes: 6 additions & 0 deletions EmailAuth/FirebaseEmailAuthUI/FUIEmailEntryViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ - (void)viewWillAppear:(BOOL)animated {
style:UIBarButtonItemStylePlain
target:nil
action:nil];

if (@available(iOS 13, *)) {
if (!self.authUI.isInteractiveDismissEnabled) {
self.modalInPresentation = YES;
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ - (void)viewWillAppear:(BOOL)animated {
style:UIBarButtonItemStylePlain
target:nil
action:nil];

if (@available(iOS 13, *)) {
if (!self.authUI.isInteractiveDismissEnabled) {
self.modalInPresentation = YES;
}
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions PhoneAuth/FirebasePhoneAuthUI/FUIPhoneEntryViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ - (void)viewWillAppear:(BOOL)animated {
style:UIBarButtonItemStylePlain
target:nil
action:nil];

if (@available(iOS 13, *)) {
if (!self.authUI.isInteractiveDismissEnabled) {
self.modalInPresentation = YES;
}
}
}
}

Expand Down