title: Enum of structs in Swift 3.0
body: <p>I am trying to create an enum of a struct that I would like to initialize:</p>
  
  <pre><code>struct CustomStruct {
      var variable1: String
      var variable2: AnyClass
      var variable3: Int
  
      init (variable1: String, variable2: AnyClass, variable3: Int) {
          self.variable1 = variable1
          self.variable2 = variable2
          self.variable3 = variable3
      }
  }
  
  enum AllStructs: CustomStruct {
      case getData
      case addNewData
  
      func getAPI() -&gt; CustomStruct {
          switch self {
              case getData:
                  return CustomStruct(variable1:"data1", variable2: SomeObject.class, variable3: POST)
  
              case addNewData:
                  // Same to same
  
              default:
                  return nil
          }
      }
  }
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <blockquote>
    <p>Type AllStructs does not conform to protocol 'RawRepresentable'</p>
  </blockquote>
  
  <p>I am assuming that enums cannot be used this way. We must use primitives.</p>