I have an SKShapeNode (rectangle in this case) which I am trying to rotate along its center. However it is rotating along the screen's bottom left point. Since I cannot set an anchor point for SKShapeNode, how can I achieve my requirement (to rotate the shape along its centre). This is the code I'm trying.
let rectangle = SKShapeNode()
rectangle.path = UIBezierPath(rect: CGRectMake(view.frame.width/4, view.frame.height/2, view.frame.width/2, view.frame.width/2)).CGPath
rectangle.fillColor = UIColor.yellowColor()
rectangle.strokeColor = UIColor.yellowColor()
let oneRevolution = SKAction.rotateByAngle(360, duration: 100.0)
let repeat = SKAction.repeatActionForever(oneRevolution)
rectangle.runAction(repeat)