title: How can i pass class as a parameter to a function in Swift?
body: <p>Let us consider i have two different classes. </p>
  
  <pre><code>class A {
  var something = "Hello"
  }
  
  class B {
  var something = "World"
  }
  </code></pre>
  
  <p>Now </p>
  
  <pre><code>class C {
  
  func request() {
  
      //Call with class A or B it can contain any class. I can call either class A or B depending on condition
      update(myClass: A or B)
  }
  
  func update(myClass:A or B ) {
      print(myClass.something) //Since both class have same varaible var something so this code should work either i pass class A or B through function
  }
  
  }
  </code></pre>
  
  <p>Plz help me achieve this using Swift</p>