title: Dynamic Struct creation in Swift - based on user input
body: <p>I am trying to create dynamic struct in swift based on user input. </p>
  
  <pre><code>struct Diagnosis {
  
  var diagName = String() // Name of the diagnosis
  var diagSymptoms = [String]() // Symptoms of the diagnosis in a ranked array to identify prevelancy
  var diagSpecialization = [String]() //  the specializations which would mostly encounter this diagnosis
  var diagRank = Int() // the overall rank of the diagnosis
  var diagSynonoms = [String]() // the other name thru which the same diagnosis is called / referred.
  
  //   func init(diagName: String(),diagSymptoms: [String](),diagSpecialization: [String](),diagSynonoms: [String]())
   init( let pasdiagName: String,let pasdiagSymptoms:Array&lt;String&gt;) {
      self.diagName = pasdiagName
      self.diagSymptoms = pasdiagSymptoms
  }
  }
  
  var maleria = Diagnosis(pasdiagName: "Maleria",pasdiagSymptoms: ["fever","chill","body pain"])
  </code></pre>
  
  <p>The above creates the structure maleria - But in future I want to have the input from user and create a structure for that inputted string </p>
  
  <pre><code>var abc = "typhoid"
  
  let valueof(abc) = Diagnosis()
  </code></pre>
  
  <p>The value of function is something I just put here arbitrarily to make my explanation clear.
  I know I could do this in python and I am new to swift.  Thanks in advance for the help. </p>