title: How to move CGRect in a custom cell?
body: <p>So, I have a custom cell class and in the implementation I have this code:</p>
  
  <pre><code>- (void)layoutSubviews {
      [super layoutSubviews];
  
      CGRect contentRect = self.contentView.bounds;
      CGFloat boundsX = contentRect.origin.x;
      CGRect frame;
  
      frame = CGRectMake(boundsX+10,10, 50, 50);
      picture.frame = frame;
  
      frame = CGRectMake(boundsX+75 ,0, 170, 50);
      nameLabel.frame = frame;
  
      frame = CGRectMake(boundsX+75 ,43, 225, 23);
      costLabel.frame = frame;
  
      frame = CGRectMake(boundsX+280, 30, 8, 13);
      arrow.frame = frame;
  }
  </code></pre>
  
  <p>Now let's see how this layout works at the picture below:</p>
  
  <p><img src="https://i.stack.imgur.com/okKoY.png" alt="enter image description here"></p>
  
  <p>I am satisfied with the result, but I also want to change <strong>costLabel</strong> position in the cell according to the <strong>nameLabel</strong>. If there are two <code>lines</code> of text in the <strong>nameLabel</strong>, I don't want to change the costLabel position, however if there are just one <code>line</code> of text in the <strong>nameLabel</strong>, I want to move <strong>costLabel</strong> upper, so I can rid off the space and make <strong>costLabel</strong> closer to <strong>nameLabel</strong>.</p>
  
  <p>I tried this in the <strong>cellForRowAtIndexPath</strong>:</p>
  
  <pre><code>CGRect frame = cell.costLabel.frame;
  frame.origin.y = frame.origin.y-10; // new y coordinate
  cell.costLabel.frame = frame;
  </code></pre>
  
  <p>But it didn't work. </p>
  
  <p>Any solutions or ideas, how can I change <code>CGRect</code> coordinates (y origin) ?</p>