title: Different return types from protocol method
body: <p>I would like to have a protocol that defines some methods and properties. However, property types and method return types may vary between the different classes that conform to said protocol. For example: <code>A.getContent()</code> may return a value of type <code>String</code>, but <code>B.getContent()</code> may return a value of type <code>Int</code>. In my example below, I used the type <code>Any</code>. Is this possible in Swift or is this a totally wrong approach? Maybe with generics?</p>
  
  <pre><code>protocol Content {
      func getContent() -&gt; any
  }
  
  class A: Content {
      func getContent() -&gt; String {
          return "Im a String"
      }
  }
  
  class B: Content {
      func getContent() -&gt; Int {
          return 1234
      }
  }
  </code></pre>