title: CALayer is not positioned correctly within the View
body: <p><strong>Context</strong></p>
  
  <p>I am using <a href="https://github.com/ariok/BWWalkthrough" rel="nofollow noreferrer">this simple library</a> to make an intro/walkthrough for my app (TL;DR, horizontal paging view controllers). I currently have 3 pages setup.</p>
  
  <p>In the 3rd walkthrough page, I have a custom <code>CALayer</code> that animates a circle in an endless loop. I'd like to add that layer to a <code>UIView</code> in order to lay it out the way I want in IB (via auto layout).</p>
  
  <p>In <code>viewDidLoad</code> (for the 3rd page) I create the circle layer and set its frame to be the same as the view I positioned, assuming the circle would be in the same spot as the view:</p>
  
  <pre><code>    for v:UIView in [view1!, view2!] {
          var pulse = PulseLayer()
          pulse.frame = v.frame
          pulse.cornerRadius = v.frame.width / 2.0
          pulse.masksToBounds = false
          view.layer.insertSublayer(pulse, above: v.layer)
      }
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>When I run the app in the iPhone 6 simulator, the CALayers show up OUTSIDE their UIViews (see below).</p>
  
  <p><img src="https://i.stack.imgur.com/py7uY.gif" alt="CALayers misplaced"></p>
  
  <p>One thing I noticed immediately is the layers are not misplaced the same way--one is above its view, and the other is to the left. I am assuming this is related to the constraints on the views, but I cannot figure out how to fix it.</p>
  
  <p>Equally baffling to me is that when run on the iPhone 5 simulator, the layers appear exactly as I expect them to (see below). </p>
  
  <p><img src="https://i.stack.imgur.com/dgE15.gif" alt="Layers correctly placed"></p>
  
  <p>I feel like I am misunderstanding some of the concepts at work here. How can I get the positioning to act the same? (Like the iPhone5 gif.)</p>
  
  <p>Or, is there a better way to do what I am trying to do?</p>