Q:

Node not moving once Physics added to scene: swift, SpriteKit

every time I add the following code:
self.physicsBody = SKPhysicsBody(edgeLoopFromRect: self.frame)
the physics body for my "ball" item stops moving. It worked before adding the previous line.
here is all my code:
class GameScene: SKScene {
    // creaTE nODE/Sprite
    let ball = SKSpriteNode(imageNamed: "ball.png")
    override func didMoveToView(view: SKView) {
        // set up scene here
        self.backgroundColor = SKColor.whiteColor()
        //add physics to scene
        self.physicsBody = SKPhysicsBody(edgeLoopFromRect: self.frame)
        //create cg piont for sprite
        ball.position = CGPointMake(size.width / 2, size.height / 2)
        //give it some real life physics!
        ball.physicsBody = SKPhysicsBody(circleOfRadius: size.height / 2)
        addChild(ball)
    }
    override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {}
    override func update(currentTime: CFTimeInterval) {
        /* Called before each frame is rendered */
    }
}

A:

This line is causing the problem:
ball.physicsBody = SKPhysicsBody(circleOfRadius: size.height / 2)

You need to use 
ball.physicsBody = SKPhysicsBody(circleOfRadius: ball.size.height / 2)

The physicsBody being created in the previous line was the size of the scene, hence it did not have space to move!
You can check the physicsBody being created by setting the showsPhysics property to YES in the SKView. Check here for more details.

