How to do it...

  1. Open the storyboard file, go to the table view, and select the prototype cell.
  2. Change its Style from Attribute Inspector tab to Custom.
  3. Change the cell height to 70 pixels.
  4. From the Object Library, drag a UIImageView to add it as a subview to the custom cell. Add it at location (0, 0) with the same size as the custom cell.
  5. Add Autolayout constraints to the image view as follows:
      FoodImage.leading = Superview.leading 
      FoodImage.top = Superview.top 
      FoodImage.trailing = Superview.trailing 
      FoodImage.bottom = Superview.bottom 
  1. Open the Attribute Inspector tab and change the image name to Sushi. Change the mode to Aspect Fill to make the image fill the size, but keeping the aspect ratio:
  1. Now, drag a UILabel from Object Library ...

Get iOS Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.