如何使用其他类属性重命名标签?

时间:2016-05-15 13:06:35

标签: swift2

所以,这是类OnboardingViewController的一部分,其中声明并初始化reviewConsentStep

class OnboardingViewController: UIViewController {
// MARK: IB actions

@IBAction func joinButtonTapped(sender: UIButton) {
    let consentDocument = ConsentDocument()
    let consentStep = ORKVisualConsentStep(identifier: "VisualConsentStep", document: consentDocument)

    let healthDataStep = HealthDataStep(identifier: "Health")

    let signature = consentDocument.signatures!.first!

    let reviewConsentStep = ORKConsentReviewStep(identifier: "ConsentReviewStep", signature: signature, inDocument: consentDocument)

    reviewConsentStep.text = "Review the consent form."
    reviewConsentStep.reasonForConsent = "Consent to join the Developer Health Research Study."

    let passcodeStep = ORKPasscodeStep(identifier: "Passcode")
    passcodeStep.text = "Now you will create a passcode to identify yourself to the app and protect access to information you've entered."

    let completionStep = ORKCompletionStep(identifier: "CompletionStep")
    completionStep.title = "Welcome aboard."
    completionStep.text = "Thank you for joining this study."

    let orderedTask = ORKOrderedTask(identifier: "Join", steps: [consentStep, reviewConsentStep, healthDataStep, passcodeStep, completionStep])
    let taskViewController = ORKTaskViewController(task: orderedTask, taskRunUUID: nil)
    taskViewController.delegate = self

    presentViewController(taskViewController, animated: true, completion: nil)
}

我想在这里使用reviewConsentStep.signature?.givenNamereviewConsentStep.signature?.familyName

@IBOutlet var applicationNameLabel: UILabel!    

override func viewDidLoad() {
    super.viewDidLoad()
    applicationNameLabel.text = reviewConsentStep.signature?.givenName/////////... here

如果有可能,请告诉我该怎么做?

0 个答案:

没有答案