     
     override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CalendarCell
-        cell.eventDateLabel.text = getDateFormatter().string(from: events[indexPath.row].startDate)
-        cell.locationLabel.text = events[indexPath.row].location
+        let event = events[indexPath.row]
+        print("Event identifier \(event.eventIdentifier)")
+        cell.eventDateLabel.text = getDateFormatter().string(from: event.startDate)
+        cell.locationLabel.text = event.location
         return cell
     }
     

    
    override func viewDidLoad() {
        super.viewDidLoad()
        requestAccessToCalendar()
        tableView.estimatedRowHeight = 60
        tableView.rowHeight = UITableViewAutomaticDimension
    }
    
    override func viewWillAppear(_ animated: Bool) {
        loadEvents()
        tableView.reloadData()
        NotificationCenter.default.addObserver(self, selector: #selector(ViewController.storeChanged(_:)), name: NSNotification.Name.EKEventStoreChanged, object: eventStore)
    }
    
    func storeChanged(_ nsNotification: NSNotification) {
        //print("Method invoked")
        //print("Event name \(nsNotification)")
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    func  saveCalendar() {

extension ViewController: EKEventEditViewDelegate {
    
    func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) {
        loadEvents()
        self.dismiss(animated: true, completion: nil)
    }
    
