title: How to derive class from Measurement in Swift
body: <p>I want to derive a class in swift 3 from the Measurement class so I can add additional functionality to define a "Imperial" and "Metric" default unit for each measurement. How do I do this? Following is how I have started.</p>
  
  <pre><code>enum UnitOptions { case imperial, metric }
  
  class CustomMeasurement : Measurement {
  
      let imperialUnit: Unit
      let metricUnit: Unit
      let inputMeasurement = Measurement&lt;Unit&gt;
  
      init( value: Double, inputUnit: Unit, imperialUnit: Unit, metricUnit: Unit) {
          self.imperialUnit = imperialUnit
          self.metricUnit = metricUnit
  
          inputMeasurement = Measurement&lt;Unit&gt;( value: value, unit: inputUnit)
      }
  
      func getMeasurement( unitSystem: UnitOptions) {
          if (unitSystem == .imperial) {
              return inputMeasurement.converted(to: imperialUnit)
          } else {
             return inputMeasurement.converted(to: metricUnit)
          }
      }
  }
  </code></pre>