title: Trying to override "selected" in UICollectionViewCell Swift for custom selection state
body: <p>I am trying to implement a custom selection style for my cells in a UICollectionView. Even though it is easily possible to do this manually in the didSelect and didDeSelect methods I would like to achieve this by manipulating the "selected" variable in UICollectionViewCell. </p>
  
  <p>I have this code for it:</p>
  
  <pre><code>    override var selected: Bool {
      get {
          return super.selected
      }
      set {
          if newValue {
              self.imageView.alpha = 0.5
              println("selected")
          } else if newValue == false {
              self.imageView.alpha = 1.0
              println("deselected")
          }
      }
  }
  </code></pre>
  
  <p>Now, when I select a cell, the cell gets highlighted but "selected" gets printed twice and the deselection does not work (even though both UICollectionView methods are implemented). </p>
  
  <p>How would I go about this? Thanks!</p>