title: Abstract class in Swift
body: <p>I know about protocols and protocol extensions being the best way to emulate abstract classes, but what I want to do needs real abstract classes I think.</p>
  
  <p>I want a <code>BaseCollectionViewCell</code> and a <code>BaseCollectionViewSource</code> that work together. You'd pass an array to a subclass of the <code>BaseCollectionViewSource</code> and implement a method that returns a reuse identifier. The cell would be instantiated by the <code>BaseCollectionViewSource</code> and have a method <code>setData</code> that would be overridden in the concrete collectionViewCell.</p>
  
  <p>What I practically want to do is this:</p>
  
  <pre><code>abstract class WRBaseCollectionViewCell: UICollectionViewCell {
      abstract func setData(_ data: AnyObject)
  }
  </code></pre>
  
  <p>But I can't emulate this with Swift (I think). Protocols can't inherit from classes and there is no dynamic dispatch, which kills my idea for everything to be overridable.</p>
  
  <p>Does anyone have an idea how to do this? A factory maybe? I want to make this as easy as possible to implement a new collectionView.</p>