title: Setting the origin of the frame in iOS
body: <p>I am trying to set the origin of the frame programmatically. </p>
  
  <p>Method1:</p>
  
  <pre><code>button.frame.origin.y = 100;
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>CGRect frame = button.frame;
  frame.origin.y = 100;
  </code></pre>
  
  <p>I tried method 1 but it is not working(showing an error saying Expression is not assignable). Method 2 is working. Why is this so?</p>
  
  <p>Need guidance on what I am doing right. </p>