Fix issue 22 - ARSCNViewDelegate Handling Content Updates#25
Fix issue 22 - ARSCNViewDelegate Handling Content Updates#25farandal wants to merge 3 commits intomapbox:masterfrom farandal:feature/issue-22
Conversation
MapboxARKit/AnnotationManager.swift
Outdated
| @objc optional func node(for annotation: Annotation) -> SCNNode? | ||
| @objc optional func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) | ||
|
|
||
| @objc optional func MBRenderer(_ renderer: SCNSceneRenderer, time: TimeInterval) |
There was a problem hiding this comment.
I think we should use s/MBRender/renderer in all of these new methods.
MapboxARKit/AnnotationManager.swift
Outdated
|
|
||
|
|
||
| public func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { | ||
| delegate?.MBRenderer!(renderer, time: time) |
There was a problem hiding this comment.
This will cause a crash if the delegate is not nil but does not implement this method. This and all other calls should not force unwrap and should use optional chaining instead. MBRenderer should be changed to renderer here at the call site, too, after you make the change noted above.
|
Hello @boundsj, I have changed the implementation approach. |
|
class ViewController: UIViewController, ARSCNViewDelegate, AnnotationManagerDelegate { ... |
For review,
This is the solution that worked for me
#22
Cheers!