Post

Replies

Boosts

Views

Activity

Reply to VisonOS Image tracking help
Could you share the console crash log for more context? One idea coming to my mind: updateImage() might be called on a non-main thread. And afaik ModelEntity should be created on the main- tread. So you could try marking the function as @MainActor.
Topic: Spatial Computing SubTopic: ARKit Tags:
May ’24
Reply to Animating a Stepper Button on SwiftUI
You could use a SwiftUI 3D Transform and apply it on the view (https://developer.apple.com/documentation/swiftui/view/rotation3deffect(_:axis:anchor:anchorz:perspective:)) or put your view into a RealityKit Attachment and then rotate the Attachment Entity (https://developer.apple.com/documentation/realitykit/transform/rotation).
Topic: Design SubTopic: General Tags:
Aug ’24
Reply to RealityKit ShaderGraphMaterial parameters in Reality Composer Pro
Hi, you likely forgot to reapply the material to the mesh after updating its parameters. RealityKit Materials are value types. I always use a helper function like this: extension Entity { func modifyMaterials(_ closure: (Material) throws -> Material) rethrows { try children.forEach { try $0.modifyMaterials(closure) } guard var comp = components[ModelComponent.self] as? ModelComponent else { return } comp.materials = try comp.materials.map { try closure($0) } components[ModelComponent.self] = comp } }
Aug ’24
Reply to macOS Sequoia – NSToolbar on Catalyst disappeared
Okay so what I've discovered so far is that for some reason the toolbars NSToolBarDelegate is being reset to nil (in the code above you can see that I indeed set it) and thus no items are being added. I have absolutely no idea why though and tested countless different setups. The same exact app runs fine on Sonoma, so what could have changed here?
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’24
Reply to macOS Sequoia – NSToolbar on Catalyst disappeared
I finally found the culprit! »Dead Code Stripping« was set to »Yes«. If I set it to no, the toolbar magically appears and the delegate is set properly. Can anyone explain to me why that would happen or is it a bug? My toolbar code is wrapped in a compiler condition #if targetEnvironment(macCatalyst)…#endif but that's the only thing I could think of.
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’24
Reply to Mac Catalyst SwiftUI – . focused() not working
Anyone? This is one of the last steps of polish of my Catalyst app that I would like to implement, but I just don't see what's going wrong. Based on these docs: https://developer.apple.com/documentation/swiftui/view/focusable(_:interactions:) The focus interactions allowed for custom views changed in macOS 14—previously, custom views could only become focused with keyboard navigation enabled system-wide. Clients built using older SDKs will continue to see the older focus behavior, while custom views in clients built using macOS 14 or later will always be focusable unless the client requests otherwise by specifying a restricted set of focus interactions. It reads to me like this should be possible with macOS 14 or later? Essentially what I want is similar to the behavior in Reality Composer Pro where when the user clicks the scene view keyboard controls are enabled to move around in the scene, whereas when focus changes e.g to elements on the sidebar keyboard navigation will cycle between them. What works in my example above is using the arrow keys right away to focus the way. Although then I only get the focus ring, but the isFocused FocusState still does not update. Very confusing. This video also didn't help much: https://developer.apple.com/documentation/swiftui/focus-cookbook-sample Is this just somewhat unfinished behavior specific to Mac Catalyst?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’25
Reply to RealityKit Systems Not Ticking Every Frame on visionOS
Instead of context.scene.performQuery did you try context.entities(matching: query, updatingSystemWhen: .rendering)?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to MFMailComposeViewController in visionOS does not have a cancel button
Same exact issue here, I think this is a bug on Apples side. Any workarounds to fix this?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to VisonOS Image tracking help
Could you share the console crash log for more context? One idea coming to my mind: updateImage() might be called on a non-main thread. And afaik ModelEntity should be created on the main- tread. So you could try marking the function as @MainActor.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Animating a Stepper Button on SwiftUI
You could use a SwiftUI 3D Transform and apply it on the view (https://developer.apple.com/documentation/swiftui/view/rotation3deffect(_:axis:anchor:anchorz:perspective:)) or put your view into a RealityKit Attachment and then rotate the Attachment Entity (https://developer.apple.com/documentation/realitykit/transform/rotation).
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to RealityKit ShaderGraphMaterial parameters in Reality Composer Pro
Hi, you likely forgot to reapply the material to the mesh after updating its parameters. RealityKit Materials are value types. I always use a helper function like this: extension Entity { func modifyMaterials(_ closure: (Material) throws -> Material) rethrows { try children.forEach { try $0.modifyMaterials(closure) } guard var comp = components[ModelComponent.self] as? ModelComponent else { return } comp.materials = try comp.materials.map { try closure($0) } components[ModelComponent.self] = comp } }
Replies
Boosts
Views
Activity
Aug ’24
Reply to macOS Sequoia – NSToolbar on Catalyst disappeared
Okay so what I've discovered so far is that for some reason the toolbars NSToolBarDelegate is being reset to nil (in the code above you can see that I indeed set it) and thus no items are being added. I have absolutely no idea why though and tested countless different setups. The same exact app runs fine on Sonoma, so what could have changed here?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to macOS Sequoia – NSToolbar on Catalyst disappeared
I finally found the culprit! »Dead Code Stripping« was set to »Yes«. If I set it to no, the toolbar magically appears and the delegate is set properly. Can anyone explain to me why that would happen or is it a bug? My toolbar code is wrapped in a compiler condition #if targetEnvironment(macCatalyst)…#endif but that's the only thing I could think of.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to realitytool requires Metal for this operation and it is not available in this build environment
Feedback ID: FB15081450
Replies
Boosts
Views
Activity
Sep ’24
Reply to Xcode 16 – Symbol not found: ShapeResource generateConvex
Nevermind, solved it by setting Other Linker Flags → -weak_framework RealityFoundation
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to RealityKit/ARKit Environment Texturing broken on iOS 18
Found a workaround! Setting environmentTexturing = .manual brings back working environment texturing!
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Gesture filtering using .targetedToEntity(where: QueryPredicate<Entity>) is not working
Did you call https://developer.apple.com/documentation/realitykit/component/registercomponent() at some point?
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Collisions are not detected if the entity is a child of a hand AnchorEntity
You probably need to set their physics simulation to .none (https://developer.apple.com/documentation/realitykit/anchoringcomponent/physicssimulation-swift.enum/none). The default is .isolated where AnchorEntities run in their own Physics Simulation scope.
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to How to set the AttractionCenter for a ParticleEmitterComponent in a System with real time updates
Hi, what is your https://developer.apple.com/documentation/realitykit/particleemittercomponent/simulationspace property currently set to? Also is this set to true or false: https://developer.apple.com/documentation/realitykit/particleemittercomponent/particlesinherittransform ?
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to HoverEffectComponent not working with ARView
The issue is still present in iOS 18 and macOS 15.2.
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to Mac Catalyst SwiftUI – . focused() not working
Anyone? This is one of the last steps of polish of my Catalyst app that I would like to implement, but I just don't see what's going wrong. Based on these docs: https://developer.apple.com/documentation/swiftui/view/focusable(_:interactions:) The focus interactions allowed for custom views changed in macOS 14—previously, custom views could only become focused with keyboard navigation enabled system-wide. Clients built using older SDKs will continue to see the older focus behavior, while custom views in clients built using macOS 14 or later will always be focusable unless the client requests otherwise by specifying a restricted set of focus interactions. It reads to me like this should be possible with macOS 14 or later? Essentially what I want is similar to the behavior in Reality Composer Pro where when the user clicks the scene view keyboard controls are enabled to move around in the scene, whereas when focus changes e.g to elements on the sidebar keyboard navigation will cycle between them. What works in my example above is using the arrow keys right away to focus the way. Although then I only get the focus ring, but the isFocused FocusState still does not update. Very confusing. This video also didn't help much: https://developer.apple.com/documentation/swiftui/focus-cookbook-sample Is this just somewhat unfinished behavior specific to Mac Catalyst?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’25