title: Which approach for a form view conditionally showing sets of fields?
body: <p>I am working on an inventory control application that deals with a few different classes of items. The detail views for each class of item share a mostly the same items on the layout:</p>
  
  <ul>
  <li>Item Name</li>
  <li>Photo</li>
  <li>Description</li>
  <li>Qty in stock</li>
  </ul>
  
  <p>In addition to the basics, different types of items will need to show additional information, like serialized-children or required sub-items etc... In an effort to reduce the number of different layouts I was considering two options:</p>
  
  <hr>
  
  <h2>Option 1:</h2>
  
  <p>A tableview with each of these layout items (i.e.: item name, photo etc...) as a cell. Depending on the type of item only the relevant cells would be displayed and populated with data.</p>
  
  <p>As can be seen in the attached screenshot of the FileMaker solution which I am trying to replicate, the fields are stacked vertically, so visually a tableview would work.</p>
  
  <p><img src="https://i.stack.imgur.com/IKasV.png" alt="stackedUI"></p>
  
  <h2>Option 2:</h2>
  
  <p>Create a single view in Storyboard containing all of the possible fields. When a record is loaded into a view, only the relevant fields would be shown and then slide up to fill in space left by the hidden fields.</p>
  
  <hr>
  
  <p>Being a newcomer to UI, I am asking for answers to contain the pros and cons of each approach and also encourage other reasonably simple alternative approaches that would achieve the same end-result. Do note that this project is written in Swift and I have no Objective-C experience so any examples are preferably in Swift.</p>