Apple HealthKit sample code fit swift version.