title: Inverted drawing with iOS origin at bottom left of screen
body: <p>When using SpriteKit to draw an interactive line the origin begins at the bottom left of the screen instead of the topleft of the screen. As a result my x coordinates are ok but my y coordinates are inverted. I've read about affine transformations but don't understand how to apply them. It seems like this is a common problem and my code shouldn't be far from wrong. Can someone point me in the right direction? Thank you very much. </p>
  
  <pre><code>import UIKit
  import SpriteKit
  
  class ViewController: UIViewController {
  
      @IBOutlet var spriteView: SKView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          let scene = GameSprite(size: view.bounds.size)
          spriteView.showsDrawCount = true
          spriteView.showsFPS = true
          spriteView.showsNodeCount = true
          spriteView.ignoresSiblingOrder  = true
          scene.scaleMode = .ResizeFill
          scene.anchorPoint = CGPointMake(0,0) // added since posting
          spriteView.presentScene(scene)
      }
  }
  </code></pre>
  
  <p><br></p>
  
  <pre><code>import Foundation
  import SpriteKit
  
  class GameSprite: SKScene {
      var startPoint = CGPointMake(0,0)
      var endPoint = CGPointMake(0,0)
      var node = SKShapeNode();
  
      override func didMoveToView(view: SKView) {
  
      }
  
      override func touchesBegan(touches: Set&lt;NSObject&gt;, withEvent     event: UIEvent) {
          if let touch = touches.first as? UITouch {
              startPoint = touch.locationInView(view)
          }
          node.removeFromParent()
  
          addNode()
      }
  
      override func touchesMoved(touches: Set&lt;NSObject&gt;, withEvent event: UIEvent) {
          if let touch = touches.first as? UITouch {
              endPoint = touch.locationInView(view)
          }
  
          modifyNode(endPoint)
      }
  
      override func touchesEnded(touches: Set&lt;NSObject&gt;, withEvent event: UIEvent) {
          if let touch = touches.first as? UITouch {
              endPoint = touch.locationInView(view)
          }
          modifyNode(endPoint)
      }
  
      func addNode() {
  
          var pathToDraw = CGPathCreateMutable();
          CGPathMoveToPoint(pathToDraw, nil, startPoint.x, startPoint.y);
          CGPathAddLineToPoint(pathToDraw, nil, endPoint.x, endPoint.y);
  
          node.path = pathToDraw;
          node.strokeColor = SKColor.redColor()
          addChild(node)
      }
  
      func modifyNode(point: CGPoint) {
          endPoint = point
  
          var pathToDraw = CGPathCreateMutable();
          CGPathMoveToPoint(pathToDraw, nil, startPoint.x, startPoint.y);
          CGPathAddLineToPoint(pathToDraw, nil, endPoint.x, endPoint.y);
  
          node.path = pathToDraw;
          node.strokeColor = SKColor.redColor()
          node.removeFromParent()
          addChild(node)
      }
  }
  </code></pre>