Post

Replies

Boosts

Views

Created

RealityKit, move(to:) methods works only without duration parameter
Using move(to:) method to update Entity's position works only if I don't use the the initialiser with duration parameter. sphere.move(to: newTransform, relativeTo: nil, duration: 0.75) // Absolutely no effect sphere.move(to: newTransform, relativeTo: nil) // Instant effect Both called from the Main thread. I don't understand what may cause this strange behaviour.
0
0
895
Oct ’22
Restoring "larger" ARWorldMap crashes the app.
Restoring "larger" ARWorldMap causes the app to crash. I am saying larger because the very same map saved earlier, with fewer anchors and feature points, does not crash and maps properly. It seems that the size of the ARWorldMap may make a difference or rather the amount of tracked anchors and feature points. I am not sure what made the exact difference but here is the ARWorldMap object and its specs: <ARWorldMap: 0x281c0cb40 center=(3.393822 0.345988 7.653722) extent=(21.671013 7.832555 20.250080) | 130 anchors, 9326 features> Tracking data: 20.4 MB The ARWorldMap is correctly fetched from the memory and passed to the configuration:  if let map = retrieveMap() {     configuration.initialWorldMap = map } The app crashes precisely before it correctly maps the surroundings.     func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) {         switch session.currentFrame?.worldMappingStatus {         case .some(.mapped):             print("found") // Never executes with the "faulty" map         default:             print("problem")         }     } My situation seems to be related to this thread but not entirely. https://developer.apple.com/forums/thread/702596
0
1
842
Oct ’22
TipUIPopoverViewController disables all the views from presenting screen
when using Tips with UIKit, presenting TipUIPopoverViewController disables all the buttons from the presenting screen. I assume this is the expected behaviour but is there a way to disable it? I would like the button that the tip is pointing to to be still enabled. Otherwise user has to tap on it twice which is not ideal. Method checking for tip's eligibility. private extension MenuViewController { func activateTips() { Task { @MainActor [weak self] in guard let self else { return } for await shouldDisplay in createMapTip.shouldDisplayUpdates { if shouldDisplay { let controller = TipUIPopoverViewController(createMapTip, sourceItem: createMapButton) { [weak self] action in if action.id == "LearnAboutMaps" { if self?.presentedViewController is TipUIPopoverViewController { self?.dismiss(animated: true) { self?.createMapTip.invalidate(reason: .actionPerformed) self?.viewModel.handle(.didTapLearnMoreAboutMaps) } } } } present(controller, animated: true) } else if presentedViewController is TipUIPopoverViewController { dismiss(animated: true) } } } } }
2
0
1.3k
Oct ’23
Bug: Tip comes back as pending first, then available when reloading screen
When loading screen, I scan for tips: private lazy var scanAreaTipTask = Task { @MainActor in for await shouldDisplay in scanAreaTip.statusUpdates { if shouldDisplay == .available { onSetBeacon.send(.scanArea(scanAreaTip, .show)) } else { onSetBeacon.send(.scanArea(scanAreaTip, .hide)) scanAreaTipFinished = true } } } Task is called in ViewDidAppear of the UIViewController. First time I load this view controller, the scanAreaTip.statusUpdates always comes back as pending. If I quit this view controller and open it again, the scanAreaTip.statusUpdates will come back as available. Why does it always come back as pending on the first opening where it should come back as available? This is the tip that I am using. As shown, there aren't any rules or options used. Just a plain tip that should show straight away. public struct ScanAreaTip: Tip { public init() {} public var title: Text { Text("Scan area around you") .brandFont(style: .regular(.headline)) .foregroundStyle(Color.accentColor) } }
1
0
795
Oct ’23