MonkeyBonkey MonkeyBonkey - 1 year ago 87
iOS Question

How should I fix the XCode 9 Beta 2 ARKit spritekit demo project so that it works

I created a new ARKit SpriteKit demo project using Xcode's new project template and saw on a tutorial https://dev.to/osterbergjordan/arkit--vision-an-intriguing-combination that I should replace this in the

viewDidLoad
. The blog author didn't know why this line should be replaced. Note that I didn't do any of the other changes in their blog - just kept the vanilla ARKit starter project with the alien invader labels on touch.

//Load the SKScene from 'Scene.sks'
if let scene = SKScene(fileNamed: "Scene") {
sceneView.presentScene(scene)
}


With this

let scene = Scene(size: self.view.frame.size)
sceneView.presentScene(scene)


which makes the demo work - but now shows the warning
Unable to load custom class 'Scene' from module '(null)'
in the logs.

Questions are:


  1. Why does the starter project not work out of the box - am I correct in changing the Scene line?

  2. If so, how do I fix the warning?



Update



As suggested by ricardopereira updating XCode beta (from beta 2 to beta 4) solved the problem. Still not sure why beta 2 had the issue with
Scene
class touch events being ignored. I've also updated the question title with the XCode version so that others having the same problem would quickly diagnose.

Answer Source
  1. Why does the starter project not work out of the box - am I correct in changing the Scene line?

The starter project work just fine out of the box. At least with Xcode Version 9.0 beta 3 (9M174d). I tested it and it compiles successfully.

enter image description here

  1. If so, how do I fix the warning?

You should contact te author of that blog because many steps on that article doesn't make sense. The author says "a bug that I encountered when creating this project_", which bug?! What is he talking about?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download