   override func viewDidLoad() {
     super.viewDidLoad()
     // Do any additional setup after loading the view, typically from a nib.
+    navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "addNewPerson")
   }
   
   override func didReceiveMemoryWarning() {

    // Dispose of any resources that can be recreated.
  }
  
}

extension ViewController:  UICollectionViewDataSource, UICollectionViewDelegate {

    let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Person", forIndexPath: indexPath) as! PersonCell
    return cell
  }
}

extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate{
  
  func imagePickerControllerDidCancel(picker: UIImagePickerController) {
    dismissViewControllerAnimated(true, completion: nil)
  }
  
  func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
    var newImage: UIImage
    
    if let possibleImage = info["UIImagePickerControllerEditedImage"] as? UIImage {
      newImage = possibleImage
    } else if let possibleImage = info["UIImagePickerControllerOriginalImage"] as? UIImage {
      newImage = possibleImage
    } else {
      return
    }
    
    let imageName = NSUUID().UUIDString
    let imagePath = getDocumentsDirectory().stringByAppendingPathComponent(imageName)
    
    if let jpegData = UIImageJPEGRepresentation(newImage, 80) {
      jpegData.writeToFile(imagePath, atomically: true)
    }
    
    dismissViewControllerAnimated(true, completion: nil)
  }
  
  func getDocumentsDirectory() -> NSString {
    let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
    let documentsDirectory = paths[0]
    return documentsDirectory
  }
}