使用SIWFT从健康应用中导出ECG的PDF数据

发布于 2025-02-09 23:03:26 字数 1130 浏览 1 评论 0原文

我有一个从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2025-02-16 23:03:26

搜索了很长时间后,我遇到了这个项目,该项目允许用户显示从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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文