Is it possible to use an ARSCNView, configure it with an ARWorldTrackingConfiguration for device that support it, and configure it another way for devices that don't support it (with A8 chip and lower) and still have the video render in the background?
if ARWorldTrackingConfiguration.isSupported{
let config=ARWorldTrackingConfiguration()
config.planeDetection = .horizontal
sceneView.session.run(config)
}else if AROrientationTrackingConfiguration.isSupported{
let config=AROrientationTrackingConfiguration()
sceneView.session.run(config)
}else{
print("not supported")
//what here? <<<
}
You need a running
ARSessionto drive the camera feed to anARSCNView, to run anARSessionyou need a supportedARConfiguration, and all configurations require A9.However, if your below-A9 fallback plan is to have a SceneKit view that doesn't get any of ARKit's motion tracking... you don't need ARKit. Just use a regular SceneKit view (
SCNView). To make the camera feed show up behind your SceneKit content, find theAVCaptureDevicefor the camera you want, and pass that to thebackground.contentsof the scene in your view.(Using a capture device as a SceneKit background is new in iOS 11. It doesn't appear to be in the docs (yet?), but it's described in the WWDC17 SceneKit session.)
By the way, there aren't any devices that support orientation tracking but don't support world tracking, so the multiple-branch
ifstatement in your question is sort of overkill.