我在 iPhone iOS 9.1 的 Swift 上使用 Xcode 7.1.1 编码和 ResearchKit。我正在尝试创建同意页面,并且一直在网上寻找没有成功的示例。
从http://www.raywenderlich.com/104575/researchkit-tutorial-with-swift,我得到了代码:
import Foundation
import ResearchKit
public var ConsentDocument:ORKConsentDocument {
let consentDocument=ORKConsentDocument()
consentDocument.title = "Consent"
//Consent Sections
let consentSectionTypes: [ORKConsentSectionType] = [
.Overview,
.DataGathering,
.Privacy,
.DataUse,
.TimeCommitment,
.StudySurvey,
.StudyTasks,
.Withdrawing
]
let consentSections: [ORKConsentSection] = consentSectionTypes.map { contentSectionType in
let consentSection = ORKConsentSection(type: contentSectionType)
consentSection.summary = "If you wish to complete this study..."
consentSection.content = "In this study you will only be asked 10 easy question!!!"
return consentSection
}
consentDocument.sections = consentSections
// Getting Signature
consentDocument.addSignature(ORKConsentSignature(forPersonWithTitle: nil, dateFormatString: nil, identifier: "ConsentDocumentParticipantSignature"))
return consentDocument
}
问题是,此代码创建的每个页面都具有相同的摘要和内容。如何为每个单独的部分制作单独的页面?