Post

Replies

Boosts

Views

Activity

Reply to Specific ARKit node not showing in AR
At any rate I implemented a workaround by passing the SCNNode by: func addNode(annotationLocation: ARCL.LocationAnnotationNode) { if let sceneNode=sceneLocationView.sceneNode { sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationLocation, sceneNode: sceneNode) } else { let completion: ((SCNNode)->Void)={(sceneNode) in DispatchQueue.main.async { print("sceneNode" + (sceneNode.description)) self.sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationLocation, sceneNode:sceneNode) self.sceneLocationView.focusItems(in: annotationLocation.frame) } } let nodeComposition = NamedSceneNode(sceneNodeCompletion: completion) nodeComposition.progress() print("count \(nodeComposition.counter)") if var viewController=UIApplication.topViewController() as? ViewControllerProtocol{ if !viewController.nodeShowingCompletions.contains(nodeComposition){ viewController.nodeShowingCompletions.insert( nodeComposition ) } } } } By processing the completions when a SCNNode is ready in: func sceneLocationViewDidUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) { guard let sceneNode=sceneLocationView.sceneNode else { return } //print("updated element"+locationNode.description + "sceneNode: " + (sceneLocationView.sceneNode?.description ?? "nil")) if let nodeCompletion = self.nodeShowingCompletions.first{ nodeCompletion.sceneNodeCompletion(sceneNode) self.nodeShowingCompletions.remove(nodeCompletion) } } Of course until Apple clarifies how to have the node to not nil in other classes respect to the first one.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’25
Reply to When I inherit from a class assigning SceneLocationView() sceneNode is nil
I sort of fixed the issue by modifying addNode as follows: func addNode(annotationLocation: ARCL.LocationAnnotationNode) { if let sceneNode=sceneLocationView.sceneNode { sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationLocation, sceneNode: sceneNode) } else { let completion: ((SCNNode)->Void)={(sceneNode) in DispatchQueue.main.async { print("sceneNode" + (sceneNode.description)) self.sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationLocation, sceneNode:sceneNode) sceneLocationView.focusItems(in: annotationLocation.frame) } } let nodeComposition = NamedSceneNode(sceneNodeCompletion: completion) nodeComposition.progress() print("count \(nodeComposition.counter)") if var viewController=UIApplication.topViewController() as? ViewControllerProtocol{ if !viewController.nodeShowingCompletions.contains(nodeComposition){ viewController.nodeShowingCompletions.insert( nodeComposition ) } } } With: struct NamedSceneNode: Hashable{ static func == (lhs: NamedSceneNode, rhs: NamedSceneNode) -> Bool { lhs.counter == rhs.counter } var sceneNodeCompletion: ((SCNNode)->Void) static var count: Int=0 var counter: Int{ return NamedSceneNode.count } func progress(){ NamedSceneNode.count+=1 print("counter ora: \(counter)") } func hash(into hasher: inout Hasher) { hasher.combine(counter) } } And then executing the completions in: func sceneLocationViewDidUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) { guard let sceneNode=sceneLocationView.sceneNode else { return } print("updated element"+locationNode.description + "sceneNode: " + (sceneLocationView.sceneNode?.description ?? "nil")) for nodeCompletion in self.nodeShowingCompletions { nodeCompletion.sceneNodeCompletion(sceneNode) DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.nodeShowingCompletions.remove(nodeCompletion) } } } Of course recycling the same sceneNodes over and over again.
May ’25
Reply to Specific ARKit node not showing in AR
In fact I added sceneLocationView.debugOptions.insert(.showWorldOrigin) sceneLocationView.debugOptions.insert(.showBoundingBoxes) sceneLocationView.debugOptions.insert(.showCameras) as suggested in the article, but nothing seems to change or be shown different anywhere. As for the Log transforms and bounding boxes, my problem is not that the annotations are misplaced, rather than they do not show up in the screen, even rotating the iPhone in all directions. Finally as for the focused example, as already said, the same code correctly displays a kind of LocationAnnotations, but not other ones.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’25
Reply to Specific ARKit node not showing in AR
I do not know if that has something to do with the not-showing LocationAnnotations, but I receive a long list of warnings of this kind: nw_endpoint_flow_failed_with_error [C9.2.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C9.2.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning tcp_output [C8.5.1:3] flags=[R.] seq=3916721535, ack=3417376628, win=2059 state=CLOSED rcv_nxt=3417376628, snd_una=3916721535 nw_endpoint_flow_failed_with_error [C8.5.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C8.5.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning tcp_output [C9.3.1:3] flags=[R.] seq=3809671418, ack=2489189421, win=2059 state=CLOSED rcv_nxt=2489189421, snd_una=3809671418 nw_endpoint_flow_failed_with_error [C9.3.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C9.3.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning tcp_output [C8.6.1:3] flags=[R.] seq=2844966683, ack=2314191636, win=2059 state=CLOSED rcv_nxt=2314191636, snd_una=2844966683 nw_endpoint_flow_failed_with_error [C8.6.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C8.6.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning nw_path_necp_check_for_updates Failed to copy updated result (22) tcp_output [C9.4.1:3] flags=[R.] seq=309905021, ack=2932137234, win=2059 state=CLOSED rcv_nxt=2932137234, snd_una=309905021 nw_endpoint_flow_failed_with_error [C9.4.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C9.4.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning tcp_output [C8.7.1:3] flags=[R.] seq=3578401679, ack=3456334273, win=2059 state=CLOSED rcv_nxt=3456334273, snd_una=3578401679 nw_endpoint_flow_failed_with_error [C8.7.1 82.223.15.117:443 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, dns, uses wifi)] already failing, returning nw_endpoint_flow_failed_with_error [C8.7.1 82.223.15.117:443 cancelled channel-flow ((null))] already failing, returning
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’25
Reply to Specific ARKit node not showing in AR
The example you quoted regards SwiftUI, while I simply use Swift. Which part should I consider to enable debugging, given the ordinary debug window seems not to work? Moreover sceneLocationView.debugOptions.insert(.showAnchorOrigins) says "Type 'SCNDebugOptions.Element' (aka 'SCNDebugOptions') has no member 'showAnchorOrigins'"
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’25
Reply to What field to enter in the UIApplicationSceneManifest for the iPad StoryBoard
The undocumented solution is to replicate the Manifest information with the iPad information as follows: <key>UIApplicationSceneManifest~ipad</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> <key>UISceneStoryboardFile</key> <string>StoryboardiPad</string> </dict> </array> </dict> </dict>
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’25
Reply to Getting original LocationNode from hit tested SCNNode
I solved it with function: func processNodeTouch(node: SCNNode){ for cloudNode in shownCloudAnnotations{ print("message matching \(cloudNode.cloud?.message ?? "no message") \(cloudNode.cloud?.index ?? 0), insideClouds: \(cloudNode.childNodes.count), cloudNode0: \(cloudNode.childNodes[0]), cloudNode: \(cloudNode), node: \(node)") if cloudNode.childNodes[0] == node || cloudNode==node{ print("index", cloudNode.index ?? "nessun indice") handleCloudTouching(cloudLocation: cloudNode) } } }
Topic: Design SubTopic: General Tags:
Apr ’25
Reply to CLLocationManagerDelegate not working on Siri Intents
The solution was simpler than that. Apparently the intent is called on a background thread, so you have to set it asynchronous to be able to start the localisation. Another issue I found is that once a value is entered in the SiriKit interaction, the intent is started from scratch removing all saved values, that have therefore to be saved persistently, like for example the location. In any event that is a matter of trial and error. Now I'm busy at how to reserve keywords so that, for example, if someone says: "Puff a cloud with today is a nice day", my Virtual Tags app would be called and post a cloud with "Today is a nice day". At present I need to mention Virtual Tags to get attention from Siri.
Apr ’25
Reply to Augmented Reality app unable to load the image from the camera
Now I just have: <<<< FigCaptureSourceRemote >>>> Fig assert: "err == 0 " at bail (FigCaptureSourceRemote.m:275) - (err=-12784) ... <<<< FigCaptureSourceRemote >>>> Fig assert: "err == 0 " at bail (FigCaptureSourceRemote.m:511) - (err=-12784) and at the beginning: ARCL.SceneLocationView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen. Unfortunately I'm stuck at Xcode Version 15.2 (15C500b) as the following ones do not work on Ventura, the last system working on my Mac.
Jan ’25