             }
         })
     }
+    
+    func managedObject(workout: HKWorkout) -> NSManagedObject? {
+        if let uuid = workout.UUID?.UUIDString {
+            let fetchRequest = NSFetchRequest(entityName: "SyncLog")
+            let predicate = NSPredicate(format: "uuid = %@", uuid)
+            fetchRequest.predicate = predicate
+            
+            let fetchedEntities = self.managedContext.executeFetchRequest(fetchRequest, error: nil)
+            
+            if let syncLog = fetchedEntities?.first as? NSManagedObject {
+                return syncLog
+            }
+        }
+        
+        return nil
+    }
 }
 


import UIKit
import HealthKit

class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
    

            if let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as? WorkoutTableViewCell {
                let workout  = self.workouts[indexPath.row]
                let startDate = workout.startDate.relativeDateFormat()
                
                if let managedObject = managedObject(workout) {
                    cell.accessoryType = .Checkmark
                }
                
                cell.startTimeLabel?.text = startDate
                cell.durationLabel?.text = stringFromTimeInterval(workout.duration)
