正如我的问题所说,我正在创建一个没有签名的 ORKConsentReviewStep 。但我想知道用户是否同意'或者“不同意”。
我试过了:
let reviewResult = result.stepResultForStepIdentifier("kReview")
let r = reviewResult?.resultForIdentifier("kReview") as! ORKChoiceQuestionResult
let choice = r.choiceAnswers?.first as! Double
但它会崩溃。
修改
我使用它来从SharingStep中获取选择,并希望ReviewStep具有相同的功能:
let sharing = result.stepResultForStepIdentifier("kSharingStep")
let s = sharing?.resultForIdentifier("kSharingStep") as! ORKChoiceQuestionResult
let theChoice = s.choiceAnswers!.first as! Double
答案 0 :(得分:2)
实际上,这看起来像是一种疏忽。由于我们的所有用户至少使用requiresName
,通常还使用requiresSignatureImage
,因此他们能够确定用户是否隐含地同意是否存在名称或签名。
请注意,ORKConsentReviewStep 不是一个问题步骤,因此它不包含问题结果。其结果的子项是ORKConsentSignatureResult
,其中记录了所获得的名称和/或签名。
应该发生的是,如果用户不同意,审核结果应该有一个标志来明确指出。
我已提交#244
答案 1 :(得分:0)
在查看文件并尝试创建自己的委托时,我找到了
@protocol ORKConsentReviewControllerDelegate <NSObject>
- (void)consentReviewControllerDidAcknowledge:(ORKConsentReviewController *)consentReviewController;
- (void)consentReviewControllerDidCancel:(ORKConsentReviewController *)consentReviewController;
@end
所以这是我自己的问题的答案:)