If you create a new iOS Single View App project in Xcode 11, the generated boilerplate code is not compatible with iOS versions earlier than iOS 13, because it assumes the new SceneDelegate API is available.
What follows are the steps needed to make the application compatible with iOS 9 and later.
For a Swift app:
- In the target's General properties, set the deployment target to iOS 9.0.
- Remove the
SceneDelegate.swift
file from the project. - In
AppDelegate.swift
, remove all methods other thanapplication(_, didFinishLaunchingWithOptions:)
from the AppDelegate class, and add this property declaration:var window: UIWindow?
- In the target's
Info.plist
, remove the "Application Scene Manifest" (UIApplicationSceneManifest) key and subkeys.
For an Objective-C app:
- In the target's General properties, set the deployment target to iOS 9.0.
- Remove the
SceneDelegate.h
andSceneDelegate.m
files from the project. - In
AppDelegate.h
, add this property declaration to the AppDelegate class:@property (strong, nonatomic) UIWindow *window;
- In
AppDelegate.m
, remove all methods other than-application:didFinishLaunchingWithOptions:
. - In the target's
Info.plist
, remove the "Application Scene Manifest" (UIApplicationSceneManifest) key and subkeys.
Note: It is possible to make the project compatible with iOS 8.0 by removing the safe-area insets from Main.storyboard, but for most people supporting iOS 8 isn't worth the effort.