I converted some old Objective-C code to the Swift equivalent & then further changes were required with visionOS. Also, the UI Kit application is using storyboards.
I also wanted to be able to present 3D content in a volumetric view along side to the UI Kit view controllers.
Adding 3D content to your app | Apple Developer Documentation
with visionOS, you can specify the default scene type for the role, I managed to get it working without this - does it default to use plain window style?
as there will be multiple window groups in visionOS:
UI Kit - app code
import UIKit
import AVFoundation
@main
class WHAppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Setting the cache size for the app; this should be re-evaluated.
// The app currently downloads JSON from Bands in Town.
let URLCache = Foundation.URLCache(memoryCapacity: 4 * 1024 * 1024,
diskCapacity: 20 * 1024 * 1024,
diskPath: nil)
Foundation.URLCache.shared = URLCache
// Configure the audio categories for the app; this can change
// if the user selects the audio mixer scene.
setAudioCategories()
setAppAppearance()
return true
}
}
visionOS - app code