I currently have a node that I want to rotate by 90 degrees around its centre for every touch. I've managed to rotate it using the code below, but not around its centre. If anyone has a way to fix this I'd really appreciate it.
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
let touch = touches.first as! UITouch
let touchLocation = touch.locationInNode(self)
if sprite.frame.contains(touchLocation) {
let rotate = SKAction.rotateByAngle(1.57, duration: 0.1)
sprite.runAction(rotate)
}
}