Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVProgressHUD not showing at centre of screen?

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!!

like image 418
Amais Sheikh Avatar asked Jul 24 '20 23:07

Amais Sheikh


1 Answers

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)
like image 198
Cr0manty Avatar answered Oct 16 '22 17:10

Cr0manty