title: iOS CustomTableViewCell: elements not aligining correctly
body: <p>I am learning <code>iOS</code> for the first time while building an app.  In one of the requirements, the <code>UITableViewCell</code> needs to look like<br />
  <img src="https://i.stack.imgur.com/jIZ00.png" alt="enter image description here" />
  (PS: This is just a design, no code was written for this)</p>
  <p>However, when I design my <code>UITableViewCell</code>, it looks like</p>
  <p><img src="https://i.stack.imgur.com/z9e3X.png" alt="enter image description here" /><br />
  <img src="https://i.stack.imgur.com/cmckg.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/x39pa.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/OIYQK.png" alt="enter image description here" /></p>
  <p>and the code to generate this looks like</p>
  <pre><code>- (void)setTransactionCell:(TransactionCell *)transactionCell transactionModel:(TransactionModel *)transactionModel {
      transactionCell.dateOfMonth.image = [self getDayImage:[UIImage imageNamed:@&quot;1&quot;]];
      transactionCell.dayOfWeek.image = [self getDayImage:[UIImage imageNamed:@&quot;Sun&quot;]];
  
      transactionCell.name.text = transactionModel.name;
      transactionCell.name.font = [UIFont fontWithName:@&quot;HelveticaNeue-Light&quot; size:15];
  
      transactionCell.amount.text = transactionModel.amount;
      transactionCell.amount.font = [UIFont fontWithName:@&quot;HelveticaNeue-Light&quot; size:15];
  
      transactionCell.categoryImage.image = [self getCategoryImage:[UIImage imageNamed:transactionModel.category]];
      transactionCell.imageView.contentMode = UIViewContentModeCenter;
  }
  
  - (UIImage *)getDayImage: (UIImage *) image {
      UIGraphicsBeginImageContextWithOptions(CGSizeMake(30, 30), NO, 0);
      [image drawInRect:CGRectMake(0, 0, 15, 15)];
      UIImage *im2 = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      return im2;
  }
  
  - (UIImage *)getCategoryImage:(UIImage *)image {
      UIGraphicsBeginImageContextWithOptions(CGSizeMake(40, 40), NO, 0);
      [image drawInRect:CGRectMake(0, 0, 36, 36)];
      UIImage *im2 = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      return im2;
  }
  </code></pre>
  <p>and finally when I run the application, I see<br />
  <img src="https://i.stack.imgur.com/Ejgsq.png" alt="enter image description here" /></p>
  <p>I am fairly new and not sure what is going wrong. I desperately tried dragging labels and images to every possible combination but nothing worked. I am missing something really basic, can you one please guide what is wrong?</p>