title: iOS frame change one property (eg width)
body: <p><em>This question was originally asked for the objective-c programming language. At the time of writing, swift didn't even exist yet.</em></p>
  <h1>Question</h1>
  <p>Is it possible to change only <em>one</em> property of a <code>CGRect</code> ?</p>
  <p>For example:</p>
  <pre><code>self.frame.size.width = 50;
  </code></pre>
  <p>instead of</p>
  <pre><code>self.frame = CGRectMake(self.frame.origin.x, 
                          self.frame.origin.y, 
                          self.frame.size.width, 
                          50);
  </code></pre>
  <p>of course I understand that <code>self.frame.size.width</code> is <em>read only</em> so I'm wondering how to do this?</p>
  <p><strong>CSS ANALOGY</strong> <em>proceed at your own risk</em></p>
  <p>for those of you who are familiar with <code>CSS</code>, the idea is very similar to using:</p>
  <pre><code>margin-left: 2px;
  </code></pre>
  <p>instead of having to change the whole value:</p>
  <pre><code>margin: 5px 5px 5px 2px;
  </code></pre>