How to find obstacles in horizontal surface using ARKIT of iOS 11(Scenekit)?

I am working on a POC using the sample provided by apple https://developer.apple.com/sample-code/wwdc/2017/PlacingObjects.zip.

Right now placing object works fine after detecting the surface. But when i move the object from the detected surface to some other space like walls or some obstacle, it is overlapping with the 3D object.

Is it possible to detect the obstacles while placing/moving the 3D object through camera? Is there any sort of API available in ARKit to find the obstacle in the surface?

If not is there any workaround or calculation that we can do to find the obstacle/wall and let user not place/move the object above/beyond the obstacle/wall?