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

The HUD position doesn't centralize on iOS 13 #1002

Closed
nanyoliveira opened this issue Nov 14, 2019 · 20 comments
Closed

The HUD position doesn't centralize on iOS 13 #1002

nanyoliveira opened this issue Nov 14, 2019 · 20 comments
Labels

Comments

@nanyoliveira
Copy link

Whenever the Loading show, it doesn't show in the middle of the screen for ios 13, works fine in the previous OS. It stays in the top left of the screen, even though the overlay works fine.

@nanyoliveira nanyoliveira changed the title The position doesn't centralize on iOS 13 The HUD position doesn't centralize on iOS 13 Nov 14, 2019
@prodia
Copy link

prodia commented Nov 19, 2019

Same problem :(

@nanyoliveira
Copy link
Author

hey @prodia! I sent a pull request with the fix that I found, and I am just waiting for the review.

The fix I found is: If you go to the file SVProgressHUD/SVProgressHUD.m in the pods and then just change this line:
CGRect orientationFrame = self.bounds
to :
CGRect orientationFrame = [[UIScreen mainScreen] bounds];

It will fix the issue in your local project, but it will go away when you update, case this is not fixed.

@kinhhopbi0
Copy link

hey @prodia! I sent a pull request with the fix that I found, and I am just waiting for the review.

The fix I found is: If you go to the file SVProgressHUD/SVProgressHUD.m in the pods and then just change this line:
CGRect orientationFrame = self.bounds
to :
CGRect orientationFrame = [[UIScreen mainScreen] bounds];

It will fix the issue in your local project, but it will go away when you update, case this is not fixed.

not working for me

@slizeray
Copy link

I did a pull request for this issue in august

#978

Is this lib still maintained?

@HoangDinhTho
Copy link

same issue now

@iHardikTrivedi
Copy link

Try this solution:
[SOLUTION]

@honkmaster
Copy link
Member

Simulator Screen Shot - iPhone 11 Pro - 2020-01-04 at 09 47 14

I can not reproduce this issue with the demo application.

@slizeray
Copy link

slizeray commented Jan 4, 2020

@honkmaster You need to adopt the new iOS 13 UIScene API

https://developer.apple.com/documentation/uikit/uiscene

@alquhait
Copy link

alquhait commented Feb 7, 2020

hey @prodia! I sent a pull request with the fix that I found, and I am just waiting for the review.

The fix I found is: If you go to the file SVProgressHUD/SVProgressHUD.m in the pods and then just change this line:
CGRect orientationFrame = self.bounds
to :
CGRect orientationFrame = [[UIScreen mainScreen] bounds];

It will fix the issue in your local project, but it will go away when you update, case this is not fixed.

Worked with me, Thanks a lot

@blavkjay
Copy link

I solved this problem by creating a window and a singleton in my appDelegate:

 static var standard: AppDelegate {
        return UIApplication.shared.delegate as! AppDelegate
    }

Then in my SceneDelegate:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
       guard let _ = (scene as? UIWindowScene) else { return }
       AppDelegate.standard.window = window

   }

@ramakrishna013
Copy link

@blavkjay Thanks for the solution. This is working for me.

@AlexTikhomirov
Copy link

Thank you, very good.

@nitinumaretiya123
Copy link

I solved this problem by creating a window and a singleton in my appDelegate:

 static var standard: AppDelegate {
        return UIApplication.shared.delegate as! AppDelegate
    }

Then in my SceneDelegate:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
       guard let _ = (scene as? UIWindowScene) else { return }
       AppDelegate.standard.window = window

   }

Many Many Thanks @blavkjay

@hayjay
Copy link

hayjay commented May 10, 2020

I solved this problem by creating a window and a singleton in my appDelegate:

 static var standard: AppDelegate {
        return UIApplication.shared.delegate as! AppDelegate
    }

Then in my SceneDelegate:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
       guard let _ = (scene as? UIWindowScene) else { return }
       AppDelegate.standard.window = window

   }

Many thanks, this worked like a charm!

@autm-syl
Copy link

autm-syl commented May 26, 2020

Add this line
(UIApplication.shared.delegate as? AppDelegate)?.self.window = window at the function
scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) in file SceneDelegate. Like that:

`func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

    (UIApplication.shared.delegate as? AppDelegate)?.self.window = window
   //...  

}`

@JPAppyAudio
Copy link

Add this line
(UIApplication.shared.delegate as? AppDelegate)?.self.window = window at the function
scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) in file SceneDelegate. Like that:

`func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

    (UIApplication.shared.delegate as? AppDelegate)?.self.window = window
   //...  

}`

This Worked for me thanks!!

@rajanaat
Copy link

rajanaat commented Jul 4, 2020

@blavkjay Thanks for the solution.

@sshahidaslamm
Copy link

hey @prodia! I sent a pull request with the fix that I found, and I am just waiting for the review.

The fix I found is: If you go to the file SVProgressHUD/SVProgressHUD.m in the pods and then just change this line:
CGRect orientationFrame = self.bounds
to :
CGRect orientationFrame = [[UIScreen mainScreen] bounds];

It will fix the issue in your local project, but it will go away when you update, case this is not fixed.

Worked For me as Well !

@stale
Copy link

stale bot commented Jun 26, 2021

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 Jun 26, 2021
@stale stale bot closed this as completed Jan 9, 2022
@Duchv2008
Copy link

Thanks blavkjay

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