プログラミングスクール最大70%OFF! ←クリックして見に行く

【Error】[Application] The app delegate must implement the window property if it wants to use a main storyboard file.

【Error】[Application] The app delegate must implement the window property if it wants to use a main storyboard file.

エラー解消方法の備忘録_φ(・_・ )

発生したエラー

【Error】’xxx’ is only available in iOS 13.0 or newerを解決した後に、実機Buildで以下のエラーが発生
The app delegate must implement the window property if it wants to use a main storyboard file.

翻訳

アプリデリゲートは、メインストーリーボードファイルを使用したい場合、windowプロパティを実装する必要があります。

原因

Xcode11以降 で作成されたプロジェクトでは、
AppDelegate.swiftにwindowプロパティが宣言されないようです。

解決手順

AppDelegate.swiftに var window: UIWindow? を追加

参考サイト

https://fluffy.es/allow-app-created-in-xcode-11-to-run-on-ios-12-and-lower/
https://stackoverflow.com/questions/56916948/xcode-11-backward-compatibility-uiwindowscene-is-only-available-in-ios-13-or-n

Swiftカテゴリの最新記事