Skip to content

Instantly share code, notes, and snippets.

@hungtruong
Last active May 2, 2019 20:11
Show Gist options
  • Save hungtruong/66b941af4f5ce3b9a66cd041fd94f3d5 to your computer and use it in GitHub Desktop.
Save hungtruong/66b941af4f5ce3b9a66cd041fd94f3d5 to your computer and use it in GitHub Desktop.
self.workoutSession = session
self.workoutBuilder = workoutSession.associatedWorkoutBuilder()
self.workoutBuilder.dataSource =
HKLiveWorkoutDataSource(healthStore: healthStore,
workoutConfiguration: workoutConfiguration)
self.workoutSession.delegate = self
self.workoutBuilder.delegate = self
self.workoutBuilder.beginCollection(withStart: Date()) { (_, _) in }
session.startActivity(with: Date())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment