SVProgressHUD not showing at centre of screen?

4.1k Views Asked by At

I have 2 projects, both are developed in iOS 13, in one of the project SVProgressHUD works fine, i.e. shows correctly on the screen in the centre, but on the other app, it shows at the top left corner of the screen.

I had searched and found that this issue was with several users developing in ios 13. But for me it is fine in one project and wrong in the other. I believe it has a separate issue, that i am unaware of!

Here are the pictures of progress attached for both apps:

Correct appearance: (centre)

enter image description here

Wrong appearance: (top left)

enter image description here

p.s. no matter which device i choose, the behaviour is fine for one app, and different for other!!

2

There are 2 best solutions below

1
On

This appearance issue is from SVProgressHUD library so, adding below code in Appdelegate.swift file didFinishLaunchingWithOptions function mentioned by @Cr0manty woking fine.

window = UIWindow(frame: UIScreen.main.bounds)
3
On

I also encountered this problem, as I understand it, this problem occurs in projects created using XCode 11 for ios 13

to fix this you need add code at Appdelegate.swift In func

application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool

Need to add validation of iOS 13 and add this line

window = UIWindow(frame: UIScreen.main.bounds)