2016-08-26 1 views
1

Как вы показываете название TaskViewController в Research Kit? Я пробовал следующее, и похоже, что он не появляется, хотя другие свойства могут быть установлены таким образом.Заголовок навигации, не отображающийся в ResearchKit

let taskViewController = ORKTaskViewController(task: ConsentTask, taskRunUUID: nil) 
    taskViewController.navigationBar.topItem!.title = "TITLE" 
    taskViewController.restorationIdentifier = "1" 
    taskViewController.delegate = self 
    presentViewController(taskViewController, animated: true, completion: nil) 

Я также попробовал taskViewController.title = "TITLE".

ответ

3

Вы должны выполнить два шага:

1) Выключите название прогресса:

taskViewController.showsProgressInNavigationBar = NO; 

2) Реализовать и установить delegate для ORKTaskViewController:

- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController { 
    stepViewController.title = @"Your title"; 
} 
Смежные вопросы