title: Create a DRY function for multiple enums (enum subclassing?)
body: <p>I have multiple enums which will all share an identical function. Is there a way to write this function once and have it present in all specified enums? Here is an example:</p>
  
  <pre><code>enum CustomerTypes: Int, CaseIterable {
      case NewCustomer = 0
      case ExistingCustomer
      case Myself
  
      private var title: String {
          switch self {
          case .NewCustomer : return StandardStrings.NewDrive.NewCustomer.string
          case .ExistingCustomer : return StandardStrings.NewDrive.ExistingCustomer.string
          case .Myself : return StandardStrings.NewDrive.Myself.string
          }
      }
  
      static var titles: [String] {
          get {
              var toReturn: [String] = []
              for value in allCases {
                  toReturn.append(value.title)
              }
  
              return toReturn
          }
      }
  }
  
  enum EnquiryTypes: Int, CaseIterable {
      case Phone = 0
      case FaceToFace
  
      private var title: String {
          switch self {
          case .Phone : return StandardStrings.Misc.Phone.string
          case .FaceToFace : return StandardStrings.Misc.FaceToFace.string
          }
      }
  
      static var titles: [String] {
          get {
              var toReturn: [String] = []
              for value in allCases {
                  toReturn.append(value.title)
              }
  
              return toReturn
          }
      }
  }
  </code></pre>
  
  <p>As you can see here, both enums share identical "titles" variables. Is there a way I can possibly create an enum/class in which they can inherit this function from?</p>
  
  <p><strong>Here are some things I have tried:</strong><br>
  <a href="https://stackoverflow.com/questions/33444932/can-you-extend-an-enum">Can you extend an enum?</a><br>
  I considered this, but I don't want to extend ALL functions that have Int rawValues</p>
  
  <p>I considered creating a protocol, then creating a function which took the protocol like this, but I still would need to implement the _allCases on every enum (as you can't inherit from CaseIterable):</p>
  
  <pre><code>protocol RBEnum {
      var title: String { get }
      var _allCases: [RBEnum] { get }
  }
  </code></pre>
  
  <p>So any ideas how I can avoid violating DRY principles on these enums?</p>