Post

Replies

Boosts

Views

Created

How to attach SwiftUI Views to entities on non-visionOS platforms?
What is the recommended way to attach SwiftUI views to RealityKit entities on macOS, iOS, etc? All the APIs seem to be visionOS only: https://developer.apple.com/documentation/realitykit/realityviewattachments https://developer.apple.com/documentation/realitykit/viewattachmentcomponent https://developer.apple.com/documentation/realitykit/presentationcomponent https://developer.apple.com/documentation/realitykit/imagepresentationcomponent My only idea is to do it "manually" with a ZStack and RealityView somehow? I submitted this as a feedback since it seemed like an oversight: FB18034856.
0
2
116
Jun ’25
Instanced Rendering in RealityKit
Does RealityKit have a way to do instanced rendering? When I clone a ModelEntity, and add it to scene, I get 1 draw call per ModelEntity – even if I don't change any properties on the entity, etc. I was hoping to use RealityKit for a 3D .nonAR game, and think this would be required.
1
3
710
Jul ’23
TextKit 2 and SwiftUI
Is it possible to use/draw a SwiftUI view in TextKit 2? The NSTextLayoutManagerDelegate seems to be built around returning a NSTextLayoutFragment. Since NSTextLayoutFragment is a class, I can't subclass it and use SwiftUI. I'd love to create my views using SwiftUI, since it's a lot faster than figuring out CGPaths, pixel perfect anti-aliasing, etc. Thanks!
0
0
1.2k
Sep ’21
SwiftUI Scene with a single window on macOS
Is it possible to only allow a single window instance on macOS? WindowGroup/DocumentGroup allow the user to create multiple instances of a window. I'd like to only allow one, for an Onboarding sequence. I've checked the Scene documentation - https://developer.apple.com/documentation/swiftui/scene, and it appears the only types conforming to the Scene protocol are WindowGroup, DocumentGroup and Settings. How can I create a single Window in a SwiftUI App? An example use case: struct TutorialScene: Scene {   var body: some Scene { 	// I don't want to allow multiple windows of this Scene! 	WindowGroup { 		TutorialView() 	}	 }
6
0
5.1k
Aug ’20