The sample code project PencilKitCustomToolPicker found at this article Configuring the PencilKit tool picker here fails to compile with the following errors in Xcode 16 beta 6
General
RSS for tagDiscuss Spatial Computing on Apple Platforms.
Post
Replies
Boosts
Views
Activity
Is it possible to show a SafariWebView in an ImmersiveSpace with hand tracking enabled?
I have an app with an initialView that launches an immersive space and opens a SafariView. I noticed that hand tracking stops working when I open the SafariView, but not when I open the TestView (which is just an empty window).
Here's the Scene:
var body: some Scene {
WindowGroup(id: "control") {
InitialView()
}.windowResizability(.contentSize)
WindowGroup(id: "test") {
TestView()
}.windowResizability(.contentSize)
WindowGroup(id: "safari") {
SafariView(url: URL(string: "some URL")!)
}
ImmersiveSpace(id: "immersiveSpace") {
ImmersiveView()
}
}
hello guys
as u know, full immersive boundary range is 3m * 3m, for safe the users.
but i need the full immersive space by more extended range.
bcuz i got the quite large area and to play more fun.
is the any problem?
thank you!
when I use openwindow to show a volume window,I want to hide the old
window ,keep it stays where it is, when I close the volume window, the old window appears again.the logic is simple, I tried to use opaque to hide the old window, but the window bar is still there, which is very annoying. how could I solve this?
Can we get the raw sensor data from the apple vision pro?
We appear to be experiencing a bug with the latest beta for visionOS, we are attempting to playback a video with a transparent background in the app. In the previous beta playback worked as expected and the transparent parts of the video were transparent. In the latest beta the background appears black. The view we are using in a SwiftUI wrapped version of AVPlayerViewController, we have narrowed the bug down to only occurring only when playback is being presented in the embedded experience mode, if playback is being done in the expanded experience then playback is as expected.
This has only only been visible on an actual device, we have been unable to replicate the behaviour in the simulator using the latest Xcode 16.0 beta(beta 5 (16A5221g))
This is sample project that shows off the bug
AFAIK there's no way to programmatically detect when an ImmersiveSpaceContent is dismissed by a user (i.e. by pressing the home button).
By comparison, ImmersiveView has .onAppear() and .onDisappear():
ImmersiveSpace(id: appModel.immersiveSpaceID) {
ImmersiveView()
.environment(appModel)
.onAppear {
appModel.immersiveSpaceState = .open
}
.onDisappear {
appModel.immersiveSpaceState = .closed
}
}
In comparison:
// No similar callbacks for here:
struct MyImmersiveSpace: ImmersiveSpaceContent {
var body: CompositorLayer { /* ... */ }
}
In visionOS2, there exists a function that enables users to raise their hand to display the home button. However, this functionality conflicts with the interaction required for the mixed display space utilized within my application. Therefore, I seek a method to disable this functionality.
In my Volume, there is a RealityView that includes lighting effects. However, when the user drags the position of the window back and forth, the farther the distance between the volume and the user, the greater the brightness of the light effect. ( I believe this may be a Beta version of a bug.)
Note: The volume windowGroup has the .defaultWorldScaling(.dynamic) property.
I am developing an immersive visionOS app based on RealityKit and SwiftUI.
This app has ModelEntities that have a PerspectiveCamera entity as child.
I want to display the camera view in a 2D window in visionOS.
I am creating the camera, and add it to the entity with
let cameraEntity = PerspectiveCamera()
cameraEntity.camera.far = 10000
cameraEntity.camera.fieldOfViewInDegrees = 60
cameraEntity.camera.near = 0.01
entity.addChild(cameraEntity)
My app is not AR. The immersive view is programmatically generated.
In iOS, I could use an ARView with non AR camera mode. However, ARView is not available in visionOS.
How can I show the camera view in a SwiftUI 2D window in the immersive space?
Hello,
I'm trying to stream stereoscopic SBS video on the APV. I see that AVPlayerViewController supports MV-HEVC video playback but it's not clear how to play SBS video on the Apple Vision Pro.
Are there any docs or examples you can share?
For my use case, SBS is the only format I can support.
I'm trying to hit an API URL, however I am getting this error
(501) Invalidation handler invoked, clearing connection
(501) personaAttributesForPersonaType for type:0 failed with error Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction."
UserInfo={NSDebugDescription=The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction.}
Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
elapsedCPUTimeForFrontBoard couldn't generate a task port
This is what my info.plist looks like -
This is the code I'm using to hit the URL and get a response
func sendMessage() {
guard let url = URL(string: "https://API_URL") else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body = ["query": message] //creates a dictionary with key:value pair
request.httpBody = try? JSONSerialization.data(withJSONObject: body) //converts the dictionary to json data and sets as body of request
isLoading = true
response = ""
URLSession.shared.dataTask(with: request) { data, _, error in //initiates async task for sending request
DispatchQueue.main.async { //async update of UI on main thread
isLoading = false
}
if let data = data, error == nil, //checks that data was received and that there is no error
let json = try? JSONSerialization.jsonObject(with: data) as? [String: String] { //parsing json response
DispatchQueue.main.async {
response = json["response"] ?? "No response"
}
}
}.resume() // starts the network request
}
Can anyone help me understand what the errors are and why I'm not able to get the response back?
We’re looking to extend the capabilities of our Apple Vision Pro app to properly support the spatial playback of 180° 3D immersive videos. Currently, when these videos are played back, they are projected onto the entire 360° sphere, which results in a distorted and less-than-optimal experience for the user.
Our goal is to ensure that the 180° video content is correctly displayed within the horizontal hemisphere only, rather than across the full sphere. We’re unsure of the best approach to achieve this and would greatly appreciate your guidance.
Would it be possible for your team to review our code and provide us with the necessary steps or adjustments needed to achieve the desired playback results?
Case-ID: 8729125
Thank you for your assistance.
If I got a file or a file URL, how to judge it is a spatial photo, a panorama photo or a spatial video? Apple's Photo app can do it.
I tried "WWDC24: Build compelling spatial photo and video experiences | Apple" and it can successfully capture spatial video.
But I found the video by my app differs from the iPhone build-in camera app in:
Videos captured with the iPhone's build-in camera app tend to have a more natural or warmer tone, while videos taken with my app appear whiter or cooler in color temperature.
In videos recorded using the iPhone's built-in camera app, the left eye image is typically sharper than the right eye image. However, in my app, this is reversed: the right eye image is clearer than the left eye image.
I've noticed that when I cover the wide-angle lens while shooting, the entire preview screen in my app becomes brighter. However, this doesn't occur when using the iPhone's built-in camera app.
Is there any api or parameters to make my app more close to the iPhone build-in app? I have tried "whiteBalanceMode" and "exposureMode" but no luck.
In the example code provided in the tutorial the following error is thrown when attempting to store actions in an animation library on the root. Specifically when trying to add actions. Is there another way to do this? The example code provided does not compile.
I have design a 3D object and exported it as a USDZ. I also 3D printed said object. I want to use the object as a 3D trigger for an AR experience I am building. My question is: is there a process that would let me take the 3D .usdz file and convert it to a .arobject or a .objcap medium/low density point cloud to use as an AR trigger. Because I do have the 3D print of the object I did use the "scan" option when setting up my scene but the "resolution"/fidelity seems really low, and the results I get are just mediocre.
I would love to take my 3D USDZ that I already have and use it to generate a file that can be used as a 3D trigger. is this possible, or is there a process to do this. I am able to take the 3D that I scan in Reality Composer (which is exported as a .objcap file), send it to reality converter on my Mac and make a USDZ from it. I am looking for a way to go the other way .USDZ > .objcap or .arobject.
I am trying to make a experience that mimic projection mapping but in AR. I have a 3D object I built and textured in substance painter. I also printed this object in a base gray color. I want to use the 3D print of the object as an AR trigger that would start a scene placing/overlaying/projection mapping the textured 3D model over the gray 3D printed model. Ideally the mapped 3D model would be spatial attached to the 3D print and move with it when the object is handled.
Hi, I would like to put a video in an ImmersiveSpace but, when people tap on maximize button from top left corner, the app crashes. Is it a way to remove that button?
I need it to be in an ImmersiveSpace because I would like to be able to instantiate it wherever I want.
I am testing RealityView on a Mac, and I am having troubles controlling the lighting.
I initially add a red cube, and everything is fine. (see figure 1)
I then activate a skybox with a star field, the star field appears, and then the red cube is only lit by the star field.
Then I deactivate the skybox expecting the original lighting to return, but the cube continues to be lit by the skybox. The background is no longer showing the skybox, but the cube is never lit like it originally was.
Is there a way to return the lighting of the model to the original lighting I had before adding the skybox?
I seem to recall ARView's environment property had both a lighting.resource and a background, but I don't see both of those properties in RealityViewCameraContent's environment.
Sample code for 15.1 Beta (24B5024e), Xcode 16.0 beta (16A5171c)
struct MyRealityView: View {
@Binding var isSwitchOn: Bool
@State private var blueNebulaSkyboxResource: EnvironmentResource?
var body: some View {
RealityView { content in
// Create a red cube 10cm on a side
let mesh = MeshResource.generateBox(size: 0.1)
let simpleMaterial = SimpleMaterial(color: .red, isMetallic: false)
let model = ModelComponent(
mesh: mesh,
materials: [simpleMaterial]
)
let redBoxEntity = Entity()
redBoxEntity.components.set(model)
content.add(redBoxEntity)
// Load skybox
let blueNeb2Name = "BlueNeb2"
blueNebulaSkyboxResource = try? await EnvironmentResource(named: blueNeb2Name)
}
update: { content in
if (blueNebulaSkyboxResource != nil) && (isSwitchOn == true) {
content.environment = .skybox(blueNebulaSkyboxResource!)
}
else {
content.environment = .default
}
}
.realityViewCameraControls(CameraControls.orbit)
}
}
Figure 1 (default lighting before adding the skybox):
Figure 2 (after activating skybox with star field; cube is lit by / reflects skybox):
Figure 3 (removing skybox by setting content.environment to .default, cube still reflects skybox; it is hard to see):
Is there any way to place 3D objects, maybe using ARKit or Metalkit in the video.
I have tried to extract frames from video, then draw a cube using SCNNode and then render it into UIImage, then gather all images and create video.
But this is not feasible solution as it creates huge memory spike and ultimately gives memory warning.
So is there any other way to draw 3D objects on the video file.