Post

Replies

Boosts

Views

Created

RealityView Not Refreshing With SwiftData
Hi, I am trying to update what entities are visible in my RealityView. After the SwiftData set is updated, I have to restart the app for it to appear in the RealityView. Also, the RealityView does not close when I move to a different tab. It keeps everything on and tracking, leaving the model in the same location I left it. import SwiftUI import RealityKit import MountainLake import SwiftData struct RealityLakeView: View { @Environment(\.modelContext) private var context @Query private var items: [Item] var body: some View { RealityView { content in print("View Loaded") let lakeScene = try? await Entity(named: "Lake", in: mountainLakeBundle) let anchor = AnchorEntity(.plane(.horizontal, classification: .any, minimumBounds: SIMD2<Float>(0.2, 0.2))) @MainActor func addEntity(name: String) { if let lakeEntity = lakeScene?.findEntity(named: name) { // Add the Cube_1 entity to the RealityView anchor.addChild(lakeEntity) } else { print(name + "entity not found in the Lake scene.") } } addEntity(name: "Island") for item in items { if(item.enabled) { addEntity(name: item.value) } } // Add the horizontal plane anchor to the scene content.add(anchor) content.camera = .spatialTracking } placeholder: { ProgressView() } .edgesIgnoringSafeArea(.all) } } #Preview { RealityLakeView() }
3
0
564
Jan ’25
XCode and Running On iPad Hardware Instead of Simulator
Last year's submission form says that if you select (Run on Xcode) the app will be in the simulator not on an iPad. Has that changed this year, as I don't see it in the terms? (My app has imported local package dependencies for Reality Composer Pro that I am not certain would work on playgrounds for iOS. And it needs the iPad camera for AR functionality.)
1
0
464
Jan ’25
Reality Composer Pro and Swift Playground Apps
Trying to add a Reality Composer Pro project into my swift playground application. Can't figure out what name to call for the package.
Replies
1
Boosts
0
Views
580
Activity
Jan ’25
iOS 18 support on Playground Apps and Stock 3D files
Hi, are we allowed to push the default support in Package.swift up to iOS 18 to allow for the latest APIs? And with the terms of the competition, can we use stock 3D USDZ assets? Thank you!
Replies
1
Boosts
0
Views
446
Activity
Jan ’25
RealityView Not Refreshing With SwiftData
Hi, I am trying to update what entities are visible in my RealityView. After the SwiftData set is updated, I have to restart the app for it to appear in the RealityView. Also, the RealityView does not close when I move to a different tab. It keeps everything on and tracking, leaving the model in the same location I left it. import SwiftUI import RealityKit import MountainLake import SwiftData struct RealityLakeView: View { @Environment(\.modelContext) private var context @Query private var items: [Item] var body: some View { RealityView { content in print("View Loaded") let lakeScene = try? await Entity(named: "Lake", in: mountainLakeBundle) let anchor = AnchorEntity(.plane(.horizontal, classification: .any, minimumBounds: SIMD2<Float>(0.2, 0.2))) @MainActor func addEntity(name: String) { if let lakeEntity = lakeScene?.findEntity(named: name) { // Add the Cube_1 entity to the RealityView anchor.addChild(lakeEntity) } else { print(name + "entity not found in the Lake scene.") } } addEntity(name: "Island") for item in items { if(item.enabled) { addEntity(name: item.value) } } // Add the horizontal plane anchor to the scene content.add(anchor) content.camera = .spatialTracking } placeholder: { ProgressView() } .edgesIgnoringSafeArea(.all) } } #Preview { RealityLakeView() }
Replies
3
Boosts
0
Views
564
Activity
Jan ’25
XCode and Running On iPad Hardware Instead of Simulator
Last year's submission form says that if you select (Run on Xcode) the app will be in the simulator not on an iPad. Has that changed this year, as I don't see it in the terms? (My app has imported local package dependencies for Reality Composer Pro that I am not certain would work on playgrounds for iOS. And it needs the iPad camera for AR functionality.)
Replies
1
Boosts
0
Views
464
Activity
Jan ’25