 
 import UIKit
 import HealthKit
+import CoreData
 
 class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
     

            })
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

            }
        })
    }
    
    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
    }
}

