         size.width += 8
         return size
     }
+    
+    func collectionView(collectionView: NSCollectionView, didSelectItemsAtIndexPaths indexPaths: Set<NSIndexPath>) {
+        if let index = indexPaths.first {
+            viewModel.selectedCandidate.value = viewModel.candidates.value[index.indexAtPosition(1)]
+        }
+    }
 
 }
import Foundation
import ReactiveCocoa

class CandidatesViewController : NSViewController, NSCollectionViewDataSource, NSCollectionViewDelegateFlowLayout {
    var viewModel:CandidatesViewModel!
    
    /// Collection view

                    let count = viewModel.candidates.value.count
                    self.collectionView.selectionIndexes = NSIndexSet(index: (count + index - 1) % count)
                }
            }
        
    }
