Skip to content

Instantly share code, notes, and snippets.

@MLKrisJohnson
Last active March 10, 2020 16:04
Show Gist options
  • Save MLKrisJohnson/1c436317c9187ec0ca7ed770f3887875 to your computer and use it in GitHub Desktop.
Save MLKrisJohnson/1c436317c9187ec0ca7ed770f3887875 to your computer and use it in GitHub Desktop.
Instructions for changing a new Xcode 11 app so it will run on iOS 9.0

Making A Simple App with Xcode 11 That Will Run in iOS 9+

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 than application(_, 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 and SceneDelegate.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment