2

I need to show 3D model via ARKit using ARSCNView, however, if user has an unsupported device A8- or iOS version 10-, so the app would use SCNView.

Is it possible to maintain that in one ViewController and Storyboard?

How should I init sceneView in Objective-C?

if (ARConfiguration.isSupported) {
      // use ARSCNView
} else {
      // use SCNView
}
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Dr_Mom
  • 63
  • 8

1 Answers1

2

In storyboard use ARSCNView and add to your ViewController fallback to SCNView:

override func loadView() {
    if (!ARConfiguration.isSupported) {
        print("ARKit not supported, using SCNView")
        view = SCNView(frame: NSRect(x: 0, y: 0, width: 640, height: 480))
    } else {
        super.loadView() // Use ARSCNView from storyboard
    }
}
Ef Dot
  • 768
  • 6
  • 18