Fox2: SCNVector3... unavailable in swift error compiling sample code Xcode 9 beta 2

Hello, I'm trying to compile the code from Fox2 available at


https://developer.apple.com/videos/play/wwdc2017/604/

Fox2


This code uses the new features of SceneKit and I presume it can only run if you have the latest beta macOS High Sierra and Xcode Beta (I have beta 2).


I downloaded the app and added developer signing. I also tried to run in my iOS device (also iOS 11 beta 2), but the code doesn't even compile. It's showing SNCVector3... errors, e.g.


SCNVector3FromFloat3 is unavailable in Swift --> SCNVector3FromFloat3. has been explicitly marked unavailable here

SCNMatrix4FromMat4 is unavailable in Swift --> SCNMatrix4FromMat4. has been explicitly marked unavailable here

SCNVector3ToFloat is unavailable in Swift --> SCNVector3ToFloat. has been explicitly marked unavailable here


What could be wrong in my setup?

Answered by franktinsley in 244190022

Yeah I think this code is using the wrong methods in swift. It looks like all you have to do is, wherever there's a build error, change it from stuff like SCNVector3FromFloat3(someStuff) to just SCNVector3(someStuff) or if it's SCNVector3ToFloat3(someStuff) change it to just float3(someStuff).

Accepted Answer

Yeah I think this code is using the wrong methods in swift. It looks like all you have to do is, wherever there's a build error, change it from stuff like SCNVector3FromFloat3(someStuff) to just SCNVector3(someStuff) or if it's SCNVector3ToFloat3(someStuff) change it to just float3(someStuff).

Thanks, that's great, did the same for SCNMatrix4FromMat4(someStuff) to SCNMatrix4(someStuff) and all the errors are now gone 😀

Fox2: SCNVector3... unavailable in swift error compiling sample code Xcode 9 beta 2
 
 
Q