BLACK FRIDAY: Save 50% on all my Swift books and bundles! >>

Is there a way to open a document in a visionOS app?

Forums > visionOS

I have a document-based app that I wrote for macOS. I'd like to open the document in an app on visionOS, but I don't see any way to build a document-based app for visionOS at the moment. Are there any workarounds to be able to open a document in an app in visionOS?

   

Yes, seems fine. I generally open and read a data file for the visionOS app that I'm working on.
I don't have experience with document-based apps, but I just tried, using the latest beta software, to create a new project, iOS, Document App, and then under the General settings for Destination, I added sipport for Apple Vision with the SDK as visionOS (it already had Apple Vision (Designed for iPad) with the SDK as iOS). The document then ran fine in the simulator as well as the actual VisionPro. It seems to work fine with either the virtual keyboard as well as the bluetooth connected keyboard and trackpad.

   

Hi, thanks for the reply!

I took a similar approach: I added a visionOS target for my existing document-based macOS app, added the file with the FileDocument struct as a target for my visionOS target, and added the DocumentGroup code to my main SwiftUI file, and it works as expected!

I guess I should mention that I accomplished this in macOS Sonoma 14.5 and Xcode 15.4.

   

Save 50% in my WWDC sale.

SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.