Q:

How to change the physics y position of a scene programmatically in swift

Alright, so I downloaded an object from a server and converted it to a scene but when I display it in real space it seems like it's y position is way off. It should be 0,0,0(x,y,z).(See image)

It's a little difficult to see but that's the leg of a cow and it should be on the table. When I downloaded the object, imported it into my project and converted it into a scene using Xcode I noticed the physics property of y was -9 and x and z were both 0. How would I change the y programmatically? I already changed the y in the image to 0. It was -9 before.
See Image Below.

A:

Looking at the model, it looks like it is actually the pivot which is causing you the problem.
You can change the pivot of your cow by using the pivot property of the SCNNode.
You can change this using an SCNMatrix4MakeTranslation e.g:
cow.pivot = SCNMatrix4MakeTranslation(0,0,0)

This may solve the problem:
//1. Get The Bounding Box Of The Node
let minimum = float3(nodeToAdd.boundingBox.min)
let maximum = float3(nodeToAdd.boundingBox.max)

//2. Set The Translation To Be Half Way Between The Vector
let translation = (maximum - minimum) * 0.5

//3. Set The Pivot
nodeToAdd.pivot = SCNMatrix4MakeTranslation(translation.x, translation.y, translation.z)

