Here is the program code

var ans : Double = 0.0 let sampleTypeBlood=HKSampleType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodGlucose) self.readMostRecentSample(sampleTypeBlood!, completion: { (mostRecentBlood, error) -> Void in if( error != nil ) { print("Error reading weight from HealthKit Store: \(error.localizedDescription)") return; } var blood: HKQuantitySample blood = (mostRecentBlood as? HKQuantitySample)!; ans = blood.quantity.doubleValueForUnit(HKUnit.moleUnitWithMolarMass(HKUnitMolarMassBloodGlucose)) // с этой строчкой возникают проблемы self.txtBox.text = String(ans) 

Closed due to the fact that the essence of the question is incomprehensible by the participants Alexey Shimansky , aleksandr barakin , user207618, pavel , Xander 14 May '17 at 20:47 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • thanks, take advantage - Valentin
  • one
    and what does not work then? - Max Mikheyenko

0