Some Xcode 11 iOS project templates aren’t iOS 12 compatible out of the box, but it’s relatively easy to make them work, here’s how:
- Select File > New… > Project…
- Select iOS and “Single View App” template, for example.
- Give the app a name, Swift, and be sure to select “Storyboard”, not “SwiftUI” (which needs
some View
andsome
requires iOS 13 according to the error message from Xcode), then select the “Next” to create the project. - Select “AppDelegate.swift” and add
@available(iOS 13, *)
on the line above each of thefunc
definitions in the “UISceneSession Lifecycle” - Add an implementation of the window property inside the AppDelegate class like so:
var window: UIWindow?
- Open “SceneDelegate.swift” and add
@available(iOS 13, *)
on the line aboveclass SceneDelegate
- Select the project file in the Project Navigator to edit project settings and select the Project in the left pane of the editor
- In the “Info” tab, change the “iOS Deployment Target” at the top of the right pane to the appropriate 12.x deployment target for your project.
- Build and Run. Good to go!
I’ve posted the two edited source files in a gist here