I'm working on a new game and I faced a problem (making the edges of the screen act like walls !) after some search I found this piece of code
self.physicsBody = SKPhysicsBody(edgeLoopFromRect: self.frame)
but the problem is that only the bottom and the top of the screen are working as edges while the right and the left edges aren't working (when I throw a ball to the left it goes for a while -of the screen- then hit the edge and return !)