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

SVProgressHUD should support single window apps adopting SceneDelegate #978

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions SVProgressHUD/SVProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ + (SVProgressHUD*)sharedView {

static SVProgressHUD *sharedView;
#if !defined(SV_APP_EXTENSIONS)
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[[UIApplication sharedApplication] delegate] window].bounds]; });
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[UIApplication sharedApplication] keyWindow].bounds]; });
#else
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; });
#endif
Expand Down Expand Up @@ -651,7 +651,7 @@ - (void)positionHUD:(NSNotification*)notification {
double animationDuration = 0.0;

#if !defined(SV_APP_EXTENSIONS) && TARGET_OS_IOS
self.frame = [[[UIApplication sharedApplication] delegate] window].bounds;
self.frame= [UIApplication sharedApplication].keyWindow.bounds;
UIInterfaceOrientation orientation = UIApplication.sharedApplication.statusBarOrientation;
#elif !defined(SV_APP_EXTENSIONS) && !TARGET_OS_IOS
self.frame= [UIApplication sharedApplication].keyWindow.bounds;
Expand Down Expand Up @@ -1224,7 +1224,7 @@ - (UIControl*)controlView {

// Update frames
#if !defined(SV_APP_EXTENSIONS)
CGRect windowBounds = [[[UIApplication sharedApplication] delegate] window].bounds;
CGRect windowBounds = [[UIApplication sharedApplication] keyWindow].bounds;
_controlView.frame = windowBounds;
#else
_controlView.frame = [UIScreen mainScreen].bounds;
Expand Down