how do I add a new ui controller

Asked on 07/30/2024

1 search

To add a new UI controller, you can follow the guidance provided in the session "Evolve your document launch experience" from WWDC 2024. Here are the steps you need to take:

  1. Subclass a View Controller: Create a subclass of a view controller that will handle the new UI.
  2. Assign Launch Options: Assign the launch options primary or secondary action to be a create document action with the intent to handle requests for new documents.
  3. Set the Delegate: Assign the delegate of the launch options browser view controller.
  4. Read the Intent: Read the browser's active document creation intent to determine which document to create.

For UIKit apps, you should make UIDocumentViewController the root view controller and apply your customizations to the launch options. This will help you emphasize your app's uniqueness and make it recognizable on first sight.

For a detailed overview, you can refer to the session Evolve your document launch experience at the 03:18 mark.

Relevant Sessions

  1. Evolve your document launch experience
  2. Explore game input in visionOS
  3. What’s new in AppKit
  4. Explore multiview video playback in visionOS

If you need more specific details or code examples, please let me know!