使用SIWFT从健康应用中导出ECG的PDF数据
我有一个从Health应用程序中获取数据的应用程序,但是我从HealthKit获得的数据不在视觉形式。那么,我有什么办法可以从健康中从健康中获得“导出到PDF”功能? 我已经使用正在获取数据的示例代码添加了示例代码。
for sample in ecgSamples {
// Handling the samples here.
print("Sampel Data: \(sample)")
let voltageQuery = HKElectrocardiogramQuery(sample) { (query, result) in
switch(result) {
case .measurement(let measurement):
if let voltageQuantity = measurement.quantity(for: .appleWatchSimilarToLeadI) {
// Handling the voltage quantity here.
print("Voltage Data: \(voltageQuantity)")
}
case .done:
print("Voltage Data Complete")
// No more voltage measurements. Finish processing the existing measurements.
case .error(let error):
print("Voltage error: \(error)") // Handle the error here.
}
}
// Execute the query.
self.healthStore.execute(voltageQuery)
}
I have an application which gets data from health app and but the data i got from healthkit is not in visual form. So is there any way i can get the "Export to pdf" functionality from health in my app ?
I have added sample code using which i am getting data.
for sample in ecgSamples {
// Handling the samples here.
print("Sampel Data: \(sample)")
let voltageQuery = HKElectrocardiogramQuery(sample) { (query, result) in
switch(result) {
case .measurement(let measurement):
if let voltageQuantity = measurement.quantity(for: .appleWatchSimilarToLeadI) {
// Handling the voltage quantity here.
print("Voltage Data: \(voltageQuantity)")
}
case .done:
print("Voltage Data Complete")
// No more voltage measurements. Finish processing the existing measurements.
case .error(let error):
print("Voltage error: \(error)") // Handle the error here.
}
}
// Execute the query.
self.healthStore.execute(voltageQuery)
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
搜索了很长时间后,我遇到了这个项目,该项目允许用户显示从ECG到您的iOS应用程序的数据。
ios ecg app
一旦您能够显示数据,就不难将该图表带到PDF。
您可能会在滚动图表上遇到问题,因此您可以尝试自己的滚动或移动地图的函数。
After searching for a long time i came across this project which allows user to show data from ECG to your iOS app.
iOS ECG App
once you are able to show data its not hard to take that chart to pdf.
You might face an issue with scrolling of chart so you can either try your own scroll or move function of map.