S01E06: [TDD 🍅 5] Testing View Controllers in Swift
7 min readJan 6, 2023
It’s time to start the UI
First, create a new Project called QuizApp
using Storyboards
and Swift
. Don’t fret 😮💨, we’ll look at using SwiftUI
in future sessions!
Next, follow these steps:
- Delete the
ViewController.swift
,Main.storyboard
, andSceneDelegate.swift
- Add
var window: UIWindow?
toAppDelegate.swift
- Remove
UISceneSession Lifecycle
( functions ) inAppDelegate
- In target
QuizApp > Info
removeMain storyboard file base name
- Update your
Info.plist
file to the following:
Our AppDelegate
will look like this:
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
Now, build and run (⌘R) and you should have an application that compiles and launches…