Cancel button does not appear in google login structure for iOS

This question can be very trivial, but it gives me a headache from the last 6 hours. I included Google in the iOS SDK in my project, and everything works fine except for the cancel button. enter image description here.

This screen appears when I click the google button on my login screen. But there is no way to reject this if the user decides to cancel the Google login. Usually the cancel button should appear in place of the left button element, but in this case it is absent.

What am I doing wrong here?

+4
source share
3 answers

- UIAppearance AppDelegate? , , . , , - UINavigationbar.appearance() AppDelegate.swift ( ObjC)

    UINavigationBar.appearance().barTintColor = UIColor(red:0.00, green:0.42, blue:0.90, alpha:1.0)
+1

:

1 - Google .

2 - google plus .

-. , .

leftBarButtonItem navigationItem. viewDidLoad

    UIButton *myButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
        [myButton setImage:[UIImage imageNamed:@"CancelImage" forState:UIControlStateNormal];
        [myButton setContentEdgeInsets:UIEdgeInsetsMake(0, -15, 0, 0)];
        [myButton addTarget:self action:@selector(backToHOmePage) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *customBackBtn = [[UIBarButtonItem alloc] initWithCustomView:myButton];
        self.navigationItem.leftBarButtonItem = customBackBtn;

backToHomePageMethod -

-(void)backToHOmePage
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
0

Try to remove GoogleSignIn.frameworkand GoogleSignIn.bundleand add them back.

Also, make sure you add GoogleSignIn.bundleXcode Project Copy Bundle Resources to your project (choose Objectives> Custom Project> Generate Phases> Copy Package Resources and add GoogleSignIn.bundle).

0
source

Source: https://habr.com/ru/post/1606379/


All Articles