Actualización Readme
@ -0,0 +1,59 @@
 | 
			
		||||
//
 | 
			
		||||
//  ConsentDocument.swift
 | 
			
		||||
//  RK-Journals
 | 
			
		||||
//
 | 
			
		||||
//  Created by Juan David Lopez Regalado on 11/11/24.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import Foundation
 | 
			
		||||
import ResearchKit
 | 
			
		||||
 | 
			
		||||
public var ConsentDocument: ORKConsentDocument {
 | 
			
		||||
 | 
			
		||||
    let consentDocument = ORKConsentDocument()
 | 
			
		||||
    consentDocument.title = "Introducción a ResearchKit" // O título de tu preferencia
 | 
			
		||||
 | 
			
		||||
    // Tipos de secciones y sus contenidos
 | 
			
		||||
    let sectionTypes: [ORKConsentSectionType] = [
 | 
			
		||||
        .overview,
 | 
			
		||||
        .dataGathering,
 | 
			
		||||
        .privacy,
 | 
			
		||||
        .dataUse,
 | 
			
		||||
        .timeCommitment,
 | 
			
		||||
        .studySurvey,
 | 
			
		||||
        .studyTasks,
 | 
			
		||||
        .withdrawing
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    let text = [
 | 
			
		||||
        "Sección 1: Bienvenido. Este estudio trata sobre...",
 | 
			
		||||
        "Sección 2: Recopilación de datos. Este estudio recopilará datos...",
 | 
			
		||||
        "Sección 3: Privacidad. Valoramos su privacidad...",
 | 
			
		||||
        "Sección 4: Uso de datos. Los datos recopilados se utilizarán para...",
 | 
			
		||||
        "Sección 5: Compromiso de tiempo. Este estudio le llevará aproximadamente...",
 | 
			
		||||
        "Sección 6: Encuesta del estudio. Para este estudio, deberá completar una encuesta...",
 | 
			
		||||
        "Sección 7: Tareas del estudio. Se le solicitará que realice estas tareas...",
 | 
			
		||||
        "Sección 8: Retiro. Para retirarse del estudio..."
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    // Crear secciones y añadirlas al documento de consentimiento
 | 
			
		||||
    var sections: [ORKConsentSection] = []
 | 
			
		||||
    
 | 
			
		||||
    for (index, sectionType) in sectionTypes.enumerated() {
 | 
			
		||||
        let section = ORKConsentSection(type: sectionType)
 | 
			
		||||
        let localizedText = NSLocalizedString(text[index], comment: "")
 | 
			
		||||
        let localizedSummary = localizedText.components(separatedBy: ".")[0] + "."
 | 
			
		||||
 | 
			
		||||
        section.summary = localizedSummary
 | 
			
		||||
        section.content = localizedText
 | 
			
		||||
        sections.append(section)
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    consentDocument.sections = sections
 | 
			
		||||
 | 
			
		||||
    // Agregar la firma de consentimiento
 | 
			
		||||
    let signature = ORKConsentSignature(forPersonWithTitle: "Participante", dateFormatString: nil, identifier: "ConsentDocumentParticipantSignature")
 | 
			
		||||
    consentDocument.addSignature(signature)
 | 
			
		||||
 | 
			
		||||
    return consentDocument
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,28 @@
 | 
			
		||||
//
 | 
			
		||||
//  IntroSegue.swift
 | 
			
		||||
//  RK-Journals
 | 
			
		||||
//
 | 
			
		||||
//  Created by Juan David Lopez Regalado on 11/11/24.
 | 
			
		||||
//
 | 
			
		||||
import UIKit
 | 
			
		||||
 | 
			
		||||
class IntroSegue: UIStoryboardSegue {
 | 
			
		||||
    
 | 
			
		||||
    override func perform() {
 | 
			
		||||
        let controllerToReplace = source.children.first
 | 
			
		||||
        let destinationControllerView = destination.view
 | 
			
		||||
        
 | 
			
		||||
        destinationControllerView?.translatesAutoresizingMaskIntoConstraints = true
 | 
			
		||||
        destinationControllerView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
 | 
			
		||||
        destinationControllerView?.frame = source.view.bounds
 | 
			
		||||
        
 | 
			
		||||
        controllerToReplace?.willMove(toParent: nil)
 | 
			
		||||
        source.addChild(destination)
 | 
			
		||||
        
 | 
			
		||||
        source.view.addSubview(destinationControllerView!)
 | 
			
		||||
        controllerToReplace?.view.removeFromSuperview()
 | 
			
		||||
        
 | 
			
		||||
        destination.didMove(toParent: source)
 | 
			
		||||
        controllerToReplace?.removeFromParent()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
		 After Width: | Height: | Size: 78 KiB  | 
| 
		 After Width: | Height: | Size: 206 KiB  | 
| 
		 After Width: | Height: | Size: 82 KiB  | 
| 
		 After Width: | Height: | Size: 136 KiB  | 
| 
		 After Width: | Height: | Size: 144 KiB  | 
| 
		 After Width: | Height: | Size: 114 KiB  | 
| 
		 After Width: | Height: | Size: 71 KiB  | 
| 
		 After Width: | Height: | Size: 58 KiB  |