title: How to do transforms on a CALayer?
body: <p>Before writing this question, I've</p>
  
  <ul>
  <li>had experience with <a href="https://stackoverflow.com/a/30929987/3681880">Affine transforms for views</a></li>
  <li>read the <a href="https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_affine/dq_affine.html#//apple_ref/doc/uid/TP30001066-CH204-SW1" rel="noreferrer">Transforms documentation</a> in the Quartz 2D Programming Guide</li>
  <li>seen <a href="http://www.raywenderlich.com/90488/calayer-in-ios-with-swift-10-examples" rel="noreferrer">this detailed CALayer tutorial</a></li>
  <li>downloaded and run the <a href="https://github.com/scotteg/LayerPlayer" rel="noreferrer">LayerPlayer project</a> from Github</li>
  </ul>
  
  <p>However, I'm still having trouble understanding how to do basic transforms on a <em>layer</em>. Finding explanations and simple examples for translate, rotate and scale has been difficult.</p>
  
  <p>Today I finally decided to sit down, make a test project, and figure them out. My answer is below. </p>
  
  <p>Notes:</p>
  
  <ul>
  <li>I only do Swift, but if someone else wants to add the Objective-C code, be my guest.</li>
  <li>At this point I am only concerned with understanding 2D transforms.</li>
  </ul>