2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Swift】SVProgressHUDの表示がiOS13以上だとおかしくなる

2
Posted at

結構古くからある「SVProgressHUD」というローダーのライブラリがあります。
癖が無くて使いやすいのですが、iOS13.0で動かしてみたら画面中央では無く何故か左上の隅っこに表示されてしまいました。

72616955-f5fd9580-395d-11ea-93e3-9d0310f525bb.png

対応策

AppDelegate.swift

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

SceneDelegate.swift

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

以上のように変更するとiOS13系でもローディングが中央に表示されるようになった。

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?