[UIKit, SwiftUI] Document-based app hangs when document initialization throws exception

Steps to reproduce:

  1. Create a default document-based app for iOS using SwiftUI or UIKit with UIDocumentViewController.
  2. In the document loading method, simulate an error by throwing an exception, for example: throw CocoaError(.coderValueNotFound)
  3. Open the app on device/simulator running iOS 18 and attempt to open or create a new document.

Expected behavior: An appropriate error message should be displayed to the user.

Actual behavior:

  • No error message is shown to the user
  • The "Create Document" button becomes permanently disabled
  • The app appears to hang or become unresponsive

Environment:

  • iOS 18, 26 beta 9
  • Both UIKit and SwiftUI implementations affected

Has anyone encountered this issue or found a workaround? This seems like a regression in iOS 18's document handling.

FB20189617, FB20189669

[UIKit, SwiftUI] Document-based app hangs when document initialization throws exception
 
 
Q