title: UITableViewCell - Adding subview while using an UITableViewCellStyle
body: <p>So I have an <em>UITableView</em> and all of its cells are being rendered with the <em>UITableViewCellStyleValue1</em>.</p>
  
  <p>This style works great for me within the <em>cell.indentationLevel</em></p>
  
  <p>Now within of the cells I need to display an <em>UISwitch</em> instead of the <em>detailTextLabel</em>. I started working at <em>cellForRowAtIndexPath</em> and here is my code.</p>
  
  <pre><code>UISwitch *switchField = [[UISwitch alloc] init];
  switchField.frame = CGRectMake(tableView.bounds.size.width - 194, 8, 94, 27);
  switchField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
  switchField.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  [cell.contentView addSubview:switchField];
  </code></pre>
  
  <p>It works great at first but whenever I rotate the device the Switch's bounds remains the same. I thought by adding an <em>UIView</em> to the <em>cell.contentView</em> it would take of aligning whenever it needed.</p>
  
  <p>What am I missing and more than anything else what should I do in order to achieve what I want to? </p>
  
  <p>Thanks.</p>