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

iOS 13.0 Crash #1031

Open
yzjzmn opened this issue Mar 19, 2020 · 8 comments
Open

iOS 13.0 Crash #1031

yzjzmn opened this issue Mar 19, 2020 · 8 comments
Labels

Comments

@yzjzmn
Copy link

yzjzmn commented Mar 19, 2020

Create the project with the XCode latest version, the key window has change,just show code:

SVProgressHUD.m

  • (SVProgressHUD*)sharedView {
    static dispatch_once_t once;

    static SVProgressHUD *sharedView;
    #if !defined(SV_APP_EXTENSIONS)
    dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[[UIApplication sharedApplication] delegate] window].bounds]; });
    #else
    dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; });
    #endif
    return sharedView;
    }

@yzjzmn
Copy link
Author

yzjzmn commented Mar 19, 2020

can't use [[[UIApplication sharedApplication] delegate] window].bounds]

@Reinoal
Copy link

Reinoal commented Mar 28, 2020

change to [UIScreen mainScreen].bounds or [UIApplication sharedApplication].keyWindow.bounds

@sagarsukode
Copy link

@Reinoal : change to [UIScreen mainScreen].bounds or [UIApplication sharedApplication].keyWindow.bounds

This solution is not working for me.

@jvanakker
Copy link

@Reinoal : change to [UIScreen mainScreen].bounds or [UIApplication sharedApplication].keyWindow.bounds

This solution is not working for me.

I also experienced a crash as soon as any SVProgressHUD call was done.
For me it worked by changing the following lines in SVProgressHUD.m to:

Line 72:
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds]; }); // SV Fix 2020

Line 657
self.frame = [UIApplication sharedApplication].keyWindow.bounds; // SV Fix 2020

Line 1231
CGRect windowBounds = [UIApplication sharedApplication].keyWindow.bounds; // SV Fix 2020

@bzeeman
Copy link

bzeeman commented May 22, 2020

@Reinoal : change to [UIScreen mainScreen].bounds or [UIApplication sharedApplication].keyWindow.bounds
This solution is not working for me.

I also experienced a crash as soon as any SVProgressHUD call was done.
For me it worked by changing the following lines in SVProgressHUD.m to:

Line 72:
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds]; }); // SV Fix 2020

Line 657
self.frame = [UIApplication sharedApplication].keyWindow.bounds; // SV Fix 2020

Line 1231
CGRect windowBounds = [UIApplication sharedApplication].keyWindow.bounds; // SV Fix 2020

Once I did this I still had a crash, just in a different place. I resolved it by adding back the missing selector to my AppDelegate. In other words:

- (UIWindow*) window{
    return _window;
}

@stale
Copy link

stale bot commented Dec 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the stale label Dec 19, 2020
@teradyl
Copy link

teradyl commented Apr 27, 2021

I just ran into this again running iOS 14.5 on XCode 12.5 RC. Are there any solutions to this?

@stale stale bot removed the stale label Apr 27, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants