As seen in the screenshot below, I set up a visionOS project at the beginning in Xcode 16 and later add iOS as a different platform it's also running.
And I use swiftUI as the framework for UI layout here. It runs smoothly on visionOS. However, when it comes to iOS, even if I have included modifiers as .edgesIgnoringSafeArea(.all), the display still shrinks to only weird certain area on the screen (I also tried to modify the ContentView() window size in App file and it doesn't work). Anybody has any idea for the across platform UI settings? What should I do to make the UI on iOS display normally (and it looks even more weird when it comes to Tab bars)?
iPad and iOS apps on visionOS
RSS for tagDiscussion about running existing iPad and iOS apps directly on Apple Vision Pro.
Posts under iPad and iOS apps on visionOS tag
36 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
In Vision OS app, We have two types of windows:
Main App Window – This is the default window that launches when the app starts. It displays the video listings and other primary content.
Immersive Space Window – This opens only when a user starts streaming or playing a video.
Issue:
When entering the immersive space, the main app window remains visible in front of it unless manually closed. To avoid this, I currently close the main window when transitioning to immersive space and reopen it when exiting. However, this causes the app to restart instead of resuming from its previous state.
Desired Behavior:
I want the main app window to retain its state and seamlessly resume from where it was before entering immersive mode, rather than restarting.
Attempts & Challenges:
Tried managing opacity, visibility, and state preservation, but none worked as expected.
Couldn’t find a way to push the main window to the background while bringing the immersive space to the foreground.
Looking for a solution to keep the main window’s state intact while transitioning between immersive and normal modes.
var format = "%7B%22sign%22%3Anull%2C%22company%22%3A%22%E5%85%84%E5%BC%9F%E6%B5%B7%E6%B4%8B%E7%A7%91%E6%8A%80%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%22%2C%22businessNo%22%3Anull%2C%22scene%22%3Anull%2C%22interviewCode%22%3A%22767676%22%7D"
let message = withVaList([]) { args in
let msg = NSString(format: format, arguments: args)
print(msg)
}
Topic:
App & System Services
SubTopic:
General
Tags:
Foundation
iPad and iOS apps on visionOS
Swift
Debugging
ive been using the mac m1 for almmost a year and it used to run vision pro simulator on xcode 15 quite smoothly but now its quitting unexpectedly showing errors in loading the realtiykit content
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Reality Composer Pro
visionOS
iPad and iOS apps on visionOS
Hi, we would like to create something where you can open multiple volumetric windows and place them in a room, our biggest issue is that we want these windows to be persistent, so when I close and reopen the app, the windows to be in the same position. We can't use immersive spaces because we also want to have the possibility to access the shared space.
Is it possible with the current features and capabilities to do that? If yes do you have some advices how can we achieve this?
The alternative is if is it possible to open the virtual display in immersive spaces or if we have the possibility to implement our own virtual display.
Hi,
I am trying to bring an existing Unity app to vision pro, and am trying to make all of the librairies compatible (the project loads native libs at runtime).
For some of them, there is an arm64 IOS .framework file that seems to build and be found easily in the device, but for one of them I only got a .dylib.
When building on xcode, it tells me it can't find it. So I added it to the lib search path in build settings, and it built. But on the device, it still can't seem to find the .dylib :
Library not loaded: ./libpdfium.dylib
Referenced from: <59B1ACCC-FFFD-3448-B03D-69AE95604C77> /private/var/containers/Bundle/Application/0606D884-CB09-44CA-8E4F-4A309D2E7053/[...].app/Frameworks/UnityFramework.framework/UnityFramework
Reason: tried: '/usr/lib/system/introspection/libpdfium.dylib' (no such file, not in dyld cache), './libpdfium.dylib' (no such file), '/usr/lib/system/introspection/libpdfium.dylib' (no such file, not in dyld cache), '//libpdfium.dylib' (no such file)
I am not used to Apple environment, is there a way to correctly reference this .dylib (not talking about compatibility here, just the first "lib found" step) ?
Thanks.
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Linker
Apple Unity Plug-Ins
visionOS
iPad and iOS apps on visionOS
before I start this could just be me and handful of people but I like to reorganize my phone screen to my needs based on what’s going on in life. I was jaut thinking it would be easier if u could get rid of all the folders at once then reorganize or something easier than this long extensive process it is now.
I have two Apple Vision Pros so that I can make and test a multi-player immersive reality game. But I am one developer, so I need to be able to take one Apple Vision Pro off, and put the other one on to see what the other device is seeing, and to ensure my game information is correctlly being sent over the network with multipeer connectivity.
But when I take one off, the Apple Vision Pro immediately goes to sleep. With Apple Vision Pro OS 1, I could put a piece of paper into the pro and they would stay on for hours, and I could take them on and off and debug my game. But now with VisionOS 2, even with the paper they soon go to sleep.
Is there a setting I can change or override as a developer to stop this auto sleep or auto lock?
I need to check things like:
when two devices are on the network, can I see them both so that players can select each other from a menu?
can i send object positions back and forth
Thank you.
I'm working on a school project that allows users to open a .USDZ file (using Quick Look) on the webpage while using Apple Vision Pro to put the object in their physical envirnment, the project is deployed on Vercel. I'm testing the page with my apple vision pro, when I click open the .USDZ file, I'm seeing a triangle with an exclamation mark while it's trying to load, but it won't load. Does anybody know how to troubleshoot this issue?
Hi everyone I am working on a small project that requires World Anchors so that I can persist my content through whenever the user chooses to leave/close the app. However I can't manage to make my Arkit session to run even though I think all the privacy permissions have been set and allowed correctly. Here is a sample code in an empty scene:
//
// WorldTrackingView.swift
// SH_AVP_Demo
//
// Created by 李希 on 9/19/24.
//
import SwiftUI
import RealityKit
import RealityKitContent
//import VisionKit
import ARKit
import Foundation
import UIKit
import simd
struct WorldTrackingView_test: View {
@State var myCube = Entity()
@Environment(.scenePhase) var myScenePhase
var body: some View {
RealityView { content in
//Load Scene
if let Scene = try? await Entity.load(named: "WorldTrackingScene", in: realityKitContentBundle){
//Add scene to the view
content.add(Scene)
//Look for the cube entity
if let cubeEntity = Scene.findEntity(named: "Cube"){
myCube = cubeEntity
// Create collission for the cube
myCube.generateCollisionShapes(recursive: true)
// Allow inputs to interact
myCube.components.set(InputTargetComponent(allowedInputTypes: .indirect))
// set some ground shadows
myCube.components.set(GroundingShadowComponent(castsShadow: true))
}
}
}
// Add drag gesture that targets any entity in the scene
.gesture(DragGesture().targetedToAnyEntity()
//Do something when the cube position changes
.onChanged{ value in value.entity.position = value.convert(value.location3D, from: .local, to: value.entity.parent!)
myCube = value.entity
// Test and see if the Arkit runs with different data providers
var session = ARKitSession()
var worldData = WorldTrackingProvider()
let planeData = PlaneDetectionProvider()
let sceneData = SceneReconstructionProvider()
do {
Task{
try await session.run([worldData])
for await update in worldData.anchorUpdates {
switch update.event {
case .added, .updated:
// Update the app's understanding of this world anchor.
print("Anchor position updated.")
case .removed:
// Remove content related to this anchor.
print("Anchor position now unknown.")
}
}
}
}catch{
print("session not running \(error.localizedDescription)")
return
}
}
//At the end of the gesture save anchor
.onEnded{ value in
}
)
}
}
#Preview(immersionStyle: .mixed) {
WorldTrackingView()
}
All is does is to generate a cube in an immersive view. The cube has collision and input components added to so that I can interact with it using a drag gesture. I decided to start an arkit session with a WorldTrackingProvider() but I keep getting the following error:
ARPredictorRemoteService <0x117e0c620>: Service configured with error: Error Domain=com.apple.arkit.error Code=501 "(null)"
Remote Service was invalidated: <ARPredictorRemoteService: 0x117e0c620>, will stop all data_providers.
ARRemoteService: remote object proxy failed with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 81 named com.apple.arkit.service.session was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 81 named com.apple.arkit.service.session was invalidated from this process.}
ARRemoteService: weak self released before invalidation
ARRemoteService: remote object proxy failed with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 81 named com.apple.arkit.service.prediction was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 81 named com.apple.arkit.service.prediction was invalidated from this process.}
ARRemoteService: weak self released before invalidation
If I switch it with a PlaneDetectionProvider() or a SceneReconstructionProvider() I get print statements in my terminal, but none if i replace it with a WorldTrackingProvider(). Any idea what could be causing this? Same code was working before a recent for xcode I believe.
My application supports iOS and visionOS, in some cases, the image asset is a little bit different on visonOS, and to make this difference, we are using the visionOS image set to assign a different image.
Here is the screenshot of the asset, the warning and the detailed warning.
I am a student developer
We are trying to implement an application that allows you to take photos in visionOS mr mode and access the photos you took.
Can the contents of the link below be used on visionOS?
https://developer.apple.com/tutorials/sample-apps/capturingphotos-captureandsave/
I would really appreciate your reply.
For reference, we plan to package the methods in swift and import the framework into Unity to use them.
Topic:
Spatial Computing
SubTopic:
General
Tags:
Frameworks
ARKit
visionOS
iPad and iOS apps on visionOS
navigationController.popToRootViewController(animated: true) does not work on Xcode 16 / iOS 18 Simulator. However, setting animated: to false works fine.
This is only happening on iOS 18 / Xcode 16.
Hi team,
Our app is going to upgrade the backend infrastructure which needs to inform an announcement to the users.
It seems there is a limitation that doesn't allow a message related to the decommissioning put up on the App's home page.
I have check some docs over internet but still not found any official one specify this topic.
Can we just put the message as mentioned above or there is actually a limit which not allow to add it in?
Thanks
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
App Store
App Review
iPad and iOS apps on visionOS
I have an application made from Flutter, which is possible to run on VisionOS by running as design to Ipad, and I would like that inside this application would be possible to go to mixed reality somehow. I am trying to do so far was to embedded the vision project that I have inside the swift application that flutter generates, but in this attempt I got an error from Xcode telling me that this way is not possible. I wonder if is there an another way that I could achieve my goal?
Hi All,
I am trying to build a new iOS app by following https://developer.apple.com/videos/play/wwdc2024/10163/?time=67
When I trying to remove all legacy VN I am getting error, I would appreciate if someone can help me get up to speed with the new Vision API
Hi,
we've been developing an iOS game using OpenGL ES, trying running compatible iOS app on Vision Pro Simulator on M1 Mac, but we met a strange EXC_BAD_ACCESS crash in glDrawElements(), while the app run normally on ios or ipad simulators with the same developing environment. The stack like following:
Our Mac is a Mac Studio(2022) with Apple M1 Max and MacOS 14.1.2.
Xcode: Version 15.3 (15E204a)
Simulator OS: Vision OS 1.1
Topic:
Graphics & Games
SubTopic:
General
Tags:
OpenGLES
Simulator
visionOS
iPad and iOS apps on visionOS
iOS app running in compatibility mode on Apple Vision Pro does not apply hoverEffect to SwiftUI View
We tested our iOS app on visionOS and found that the hover effect works on most of UIKit views, but it does not work on most of SwiftUI views.
SwiftUI views are used within UIHostingController.
I created a new project (Storyboard based iOS app) and displayed the following SwiftUI view in UIHostingController and found that the buttons in the List were highlighted, but not the standalone buttons.
struct SwiftUIView: View {
var body: some View {
List {
// This button has the hover effect.
Button {
print("Hello")
} label: {
Text("Hello")
}
}
// This button does't have the hover effect.
Button {
print("Hello")
} label: {
Text("Hello")
}
.hoverEffect()
}
}
Is there a way to highlight any SwiftUI view?
I’m trying to add screenshot for my new app, I did it the same way I have been doing this and it seems like there’s a issue with the website causing it to say that the images are still processing after hitting add to review. Is anyone having this issue, I’ve been trying on 3 different apple devices since 6pm EST.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Forums Feedback
App Review
iPad and iOS apps on visionOS
In visionOS simulator, a ContactPicker for Multiple contacts selection is shown without the Done button. Can I assume this behavior will be OK on an actual Vision Pro? I could not get a list of contacts to be selected.
On iOS, the Done button is shown ok as follows:
import ContactsUI
import Combine
struct ContactPickerView: View {
@State private var pickedNumber: String?
@StateObject private var coordinator = Coordinator()
var body: some View {
VStack {
Button("Open Contact Picker") {
openContactPicker()
}
.padding()
Text(pickedNumber ?? "")
.padding()
}
.onReceive(coordinator.$pickedNumber, perform: { phoneNumber in
self.pickedNumber = phoneNumber
})
.environmentObject(coordinator)
}
func openContactPicker() {
let contactPicker = CNContactPickerViewController()
contactPicker.delegate = coordinator
let scenes = UIApplication.shared.connectedScenes
let windowScenes = scenes.first as? UIWindowScene
let window = windowScenes?.windows.first
window?.rootViewController?.present(contactPicker, animated: true, completion: nil)
}
class Coordinator: NSObject, ObservableObject, CNContactPickerDelegate {
@Published var pickedNumber: String?
func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]){
print(contacts)
contacts.forEach { contact in
for number in contact.phoneNumbers {
let phoneNumber = number.value
print("number is = \(phoneNumber)")
}
}
}
}
}