title: How to select button in UICollectionViewCell and retrieve state for another action in swift?
body: <p>I have two buttons in a uicollectioncell and want to select one and then perform an action on the other depending on the state of the first button.
  I have tried this but it throws up : "swift fatal error: unexpectedly found nil while unwrapping an Optional value"</p>
  
  <pre><code>func firstAction(sender:UIButton) {
      var cell = Customcell()
      cell.firstButton.selected = true
      cell.firstButton.selected = !cell.firstButton.selected
  }
  
  @IBAction func secondAction(sender: UIBarButtonItem) {
      var cell = CustomCell()
      if cell.firstButton.selected == true {
          // DO stuff....
      } else {
          println("No button selected")
      }
  }
  </code></pre>
  
  <p>I set the button in cellForItemAtIndexPath like this:</p>
  
  <pre><code>let cell = collectionView.dequeueReusableCellWithReuseIdentifier(cellIdentifier, forIndexPath: indexPath) as! CustomCell
  cell.firstButton.addTarget(self, action: "firstAction:", forControlEvents: UIControlEvents.TouchUpInside)
  cell.secondButton.addTarget(self, action: "secondAction:", forControlEvents: UIControlEvents.TouchUpInside)
  </code></pre>
  
  <p>How can I fix this?</p>