title: Change width of a segmented control based on titles in each segment?
body: <p>Starts like this, which I like:<br>
  <img src="https://i.stack.imgur.com/yXQJF.png" alt="Screenshot1.png"></p>
  
  <p>But then I add a segment and this happens:<br>
  <img src="https://i.stack.imgur.com/EqSWA.png" alt="Screenshot2.png">
  The width is set in IB, not in code.</p>
  
  <p>All I need is a method to calculate width on the fly. At the end, it would do something like this:</p>
  
  <pre><code>control.width = (labelWidths + marginWidths);
  // where marginWidths = (marginWidth * control.numberOfSegments)
  </code></pre>