title: Align a programmatically created UIView's center with an auto-layout view's center
body: <p>I created an <code>UIView</code> in Storyboard that is to be centered exactly in the center of the View Controller with auto layout, and is working fine across different device sizes. I call this <code>largerView</code>.</p>
  
  <p>However, I would like to programmatically create a smaller <code>UIView</code> called <code>smallerView</code> and <strong>center</strong> the this view so that <code>smallerView.center = largerView.center</code>.</p>
  
  <p>I am running into an issue where given that <strong>auto layout</strong> is used on <code>largerView</code>, whenever I use the method above, my <code>smallerView</code> never actually centers with <code>largerView.center</code>. I noticed that it will take the center coordinates of <code>largerView</code> as they appear in Storyboard, based on the specific layout of the device I am using (in this case, the previous iPhone 5's dimensions), but not the updated center as affected by auto layout.</p>
  
  <p>A similar issue may be <a href="https://stackoverflow.com/questions/25851112/centering-modal-view-with-autolayout">discussed</a> here, except it is based on Swift. I know how constraints are created programmatically, but am unsure how to get the "refreshed" coordinates of a view after auto layout is applied.</p>
  
  <p>Thanks!</p>