1

Here is some code that was working prior to Christmas:

class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application (
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [ UIApplicationLaunchOptionsKey : Any ]?
    ) -> Bool {
        window = UIWindow( frame: UIScreen.main.bounds )
        return true
    }

I updated my project to Swift 4.0(.2) just before Christmas, came back and ran the app to discover that the same code now throws the exception mentioned in this question. Has something changed?

Joseph Beuys' Mum
  • 2,395
  • 2
  • 24
  • 50
  • @Beuy's Mum At which line is that error? May be do- catch can help you out. – Tushar Sharma Dec 28 '17 at 14:35
  • 1
    I'm pretty sure that this isn't the error in your code. Try to set up [an exception breakpoint](https://stackoverflow.com/a/17802868/3151675). – Tamás Sengel Dec 28 '17 at 14:45
  • thanks @TusharSharma – Joseph Beuys' Mum Dec 28 '17 at 15:25
  • 1
    interesting @the4kman. I made a simple boilerplate project and ran the same code, and I did get the same error, but this time helpfully with a stack trace and error description (unlike last time where it simply said "uncaught exception".) The reason was "Application windows are expected to have a root view controller at the end of application launch". Thanks for inspiring me to run a basic test project, should have thought of that first really. – Joseph Beuys' Mum Dec 28 '17 at 15:27

0 Answers0