在iOS中的Health Kit应用程序中显示月经详细信息 [英] Displaying Menstruation Details in Health Kit App in iOS

查看:328
本文介绍了在iOS中的Health Kit应用程序中显示月经详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个健康套件对象,所有正确的设置;但是,我正在尝试检索健康套件的月经数据。

I have a health kit object with all the proper setup; however, I am trying to retrieve the menstruation data of health kit.

但是,我无法在 HKQuantityTypeIdentifier 中找到相应的类型(即 HKCategoryValueMenstrualFlow )。

However, I cannot be able to find out the corresponding type in HKQuantityTypeIdentifier (i.e. HKCategoryValueMenstrualFlow).

HKCategoryValueMenstrualFlow 有一些子项,例如 HKCategoryValueMenstrualFlowLight HKCategoryValueMenstrualFlowMedium HKCategoryValueMenstrualFlowHeavy 。使用以下方法,我正在编写如下代码:

The HKCategoryValueMenstrualFlow is having some of the sub items such as HKCategoryValueMenstrualFlowLight, HKCategoryValueMenstrualFlowMedium, HKCategoryValueMenstrualFlowHeavy. Using the following method, I am writing my code like this:

-(void)viewDidLoad {

    HKHealthStore *healthStore = [[HKHealthStore alloc] init];

    HKCategoryType *q=[NSSet setWithObjects:
    [HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowHeavy],

    [HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowMedium],

    [HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowLight],

    [HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowUnspecified],nil];

    [healthStore requestAuthorizationToShareTypes:shareObjectTypes readTypes: healthStore completion:^(BOOL success, NSError *error) {

    if(success == YES) {
    }
}

我写的是这样的。但我怀疑的是如何在健康套件应用程序中显示月经数据的详细信息。请通过向我提出任何想法告诉我任何人。在此先感谢。

I am writing like this. But my doubt is how to show the details in menstruation data in the health kit app. Please tell me anybody by providing me with any idea. Thanks in advance.

推荐答案

HealthKit常量引用。您要查找的类型标识符是 HKCategoryTypeIdentifierMenstrualFlow

The available type identifier constants are available in the HealthKit constants reference. The type identifier you are looking for is HKCategoryTypeIdentifierMenstrualFlow.

这篇关于在iOS中的Health Kit应用程序中显示月经详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆