Have you checked if you have a sceneDelegate file ?
If so, you need to add an entry in your infos.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Why do you need to create the window ?
In my apps, view is created in IB and I do not need to call window nor set it key and visible.
Thanks, I did have a scene delegate, and removing it fixed the issue.
I guess a scene delegate is something new that Xcode gives you by default. I had never even heard of a Scene before.
Thanks for the feedback, glad for you it works. And don't forget to close the thread.
To answer your last question: Scenes are effectively new.
Note that scenes will become compulsory for any iPad app as soon as april 2020.
There is a good WWDC 2019 session (258 I think) about it.
In fact, adopting scene management, even on an existing project is very easy:
- create the sceneDelegate.swift
- you can keep the appdelegate functions as is ; they will be ignored on IOS 13, except appDidFinishLaunching
- In the sceneDelegate, declare all func with @available(iOS 13.0, *)
- transfer the content of appDelegate func (such as didBecomeActive) to their equivalent in SceneDelegate
- add the infos.plist section (you can copy and paste the whole section from a void project you create)
- don't forget to set the VC presentation to fullScreen instead of Automatic (otherwise, strange small size views on iPad).
And that's it.