title: Autoresizing masks programmatically vs Interface Builder / xib / nib
body: <p>I was in an (probably false) assumption that enabling the right margin indicator in xib is equivalent to using <code>UIViewAutoresizingFlexibleLeftMargin</code> inside code and so on.</p>
  
  <p>So, I used to think according to this snapshot:
  <img src="https://i.stack.imgur.com/uQExw.png" alt="enter image description here"></p>
  
  <p>Later today I had to cross check, and stumbled upon <strong><a href="https://stackoverflow.com/questions/3741566/uiview-and-autoresizingmask-ignored">this thread</a></strong>.</p>
  
  <p>And also the apple documentation, entitled with the section with title - "Handling Layout Changes Automatically Using Autoresizing Rules" in this link: <a href="https://developer.apple.com/library/content/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html" rel="noreferrer">https://developer.apple.com/library/content/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html</a></p>
  
  <p>So I now have a renewed concept in my mind as to how setting autoresizing masks programmatically would be equivalent to xib settings:</p>
  
  <p><strong>Scenario 1</strong>:
  Setting only <code>(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)</code> is equivalent to:</p>
  
  <p><img src="https://i.stack.imgur.com/DaUuS.png" alt="(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)"></p>
  
  <p>In XIB?</p>
  
  <p><strong>Scenario 2</strong>:
  Setting <code>(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)</code> in code is equivalent to:</p>
  
  <p><img src="https://i.stack.imgur.com/xEa4a.png" alt="(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)"></p>
  
  <p>In XIB?</p>
  
  <p>Are my 2 renewed scenarios correct? Am I right now in my understanding?</p>