title: Can't get layer mask to work properly
body: <p>I have a <code>UIImageView</code> called <code>zigZag</code>. All I want to do is set a layer mask on it so that it is not visible at all.</p>
  
  <p>I then want to animate the layer mask later so that the <code>UIImageView</code> becomes visible again.</p>
  
  <p>I have been working on this for 4 hours now and can't seem to figure out what the heck I'm doing wrong.</p>
  
  <pre><code>// Setup the mask layer
  // Make it the same size as our zigZag image
  // so that the entire image is covered and not visible
  
  let maskLayer = CALayer()      
  maskLayer.frame = self.zigZag!.frame
  
  self.zigZag!.layer.mask = maskLayer
  </code></pre>
  
  <p>This works, and the <code>zigZag</code> <code>UIImageView</code> is not visible on screen, but here's the thing. I can literally pass in any value I want to <code>maskLayer.frame</code> and it will still be hidden.</p>
  
  <p>This leads me to believe that I am doing something fundamentally wrong when thinking about creating my mask layers. There is a lot more to this problem I am trying to achieve, but I figured the first step was figuring out how to properly set a mask layer to hide an entire <code>UIImageView</code> to make it appear as if it is not even on screen.</p>
  
  <p>Thanks for the help I greatly appreciate it.</p>