title: Set effect on selected cell in uicollectionview(single selection) ios swift
body: <p>I am using collection view for horizontal scrolling. Its working pretty well. Now I want to set any effect for selecting any cell. So, I wrote this code"</p>
  
  <pre><code> func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {   
          let cell = collectionView.cellForItemAtIndexPath(indexPath)
          cell?.layer.borderColor = .None
          cell!.layer.borderWidth = 2.0
          cell!.layer.borderColor = UIColor.whiteColor().CGColor
  
  
          let dic1 = arr.objectAtIndex(indexPath.row) as! NSDictionary
          let url = dic1["url"] as! String
          let requestURL = NSURL(string:url)
          let request = NSURLRequest(URL: requestURL!)
  
          webviewfortab.loadRequest(request)
  
  
      }
  </code></pre>
  
  <p>This sets border for selected cell. But, when I select another cell, both the cell are getting selected but I want only single selection so that when user selects one,old one must be disselected.</p>