7

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

Amais Sheikh
  • 421
  • 5
  • 12

2 Answers2

24

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)
Cr0manty
  • 375
  • 1
  • 6
  • 1
    Thanks for the help. What i did was, i moved from SVProgressHUD to MBProgressHUD and i made it worked in the other app. p.s for information - Both of them have their own advantages over the each other. For my type of programmer I would prefer using MBProgressHUD as it automatically disable user interaction when the hud is on screen. – Amais Sheikh Sep 10 '20 at 07:22
  • Above fix only works correctly in Portrait orientation. When app starts on Landscape, it's wrong again. – geohei Aug 07 '23 at 15:39
  • I found this fix to be working. https://github.com/SVProgressHUD/SVProgressHUD/issues/1002#issuecomment-555940717 – geohei Aug 07 '23 at 15:52
1

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)
ham118
  • 31
  • 4