Programmatic ios app

My checklist when making a programmatic iOS app

  1. Pick storyboard when you init the iOS project (not swiftUI)
  2. Clean up the AppDelegate.swift class and add a Window variable:
  3. Delete Main storyboard file base name in the info.plist (since xCode 11 also remove scenedelegate)
  4. Now you can delete ViewController.swift and Main.storyboard (since xCode 11 also remove scenedelegate)
  5. Add MainVC and MainView
  6. CMD + R Run the app, if the background is orange it works
  7. In recent xCode apps you need to also remove main from Target -> Main interface -> Set field to blank (might require xcode clean / restart)


import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
   lazy var window: UIWindow? = createWindow()
   func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
      _ = window
      return true
extension AppDelegate {
   func createWindow() -> UIWindow {
      let win = UIWindow(frame: UIScreen.main.bounds)
      let vc = ViewController()
      win.rootViewController = vc
      win.makeKeyAndVisible() // Important since we have no Main storyboard anymore
      return win
class ViewController: UIViewController {
   override func viewDidLoad() {
      view = View()
      view.backgroundColor = .orange
   override var prefersStatusBarHidden: Bool { return true }
class View: UIView {
   override init(frame: CGRect) {
      super.init(frame: frame)
    * Boilerplate
   required init?(coder aDecoder: NSCoder) {
      fatalError("init(coder:) has not been implemented")

Info.plist xml boilerplate:

Example of info.plist for iOS

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">