ResearchKit: проблема с отображением textScale для слайдера - PullRequest
0 голосов
/ 07 января 2019

Я пытаюсь показать слайдер с текстом для выбора. Однако следующий код не работает. Не могли бы вы помочь мне выяснить проблему с этим?

var textChoice1, textChoice2, textChoice3, textChoice4, textChoice5 : ORKTextChoice
            textChoice1 = ORKTextChoice(text: "Stage 1", value: 1 as NSCoding & NSCopying & NSObjectProtocol)
            textChoice2 = ORKTextChoice(text: "Stage 2", value: 2 as NSCoding & NSCopying & NSObjectProtocol)
            textChoice3 = ORKTextChoice(text: "Stage 3", value: 3 as NSCoding & NSCopying & NSObjectProtocol)
            textChoice4 = ORKTextChoice(text: "Stage 4", value: 4 as NSCoding & NSCopying & NSObjectProtocol)
            textChoice5 = ORKTextChoice(text: "Stage 5", value: 5 as NSCoding & NSCopying & NSObjectProtocol)

            let textChoices: [ORKTextChoice] = [textChoice1, textChoice2, textChoice3, textChoice4, textChoice5];
            answerFormat = ORKAnswerFormat.textScale(with: textChoices, defaultIndex: 1, vertical: false)

Это прекрасно работает, если я делаю

answerFormat = ORKAnswerFormat.scale(withMaximumValue: 5, minimumValue: 0, defaultValue: 0, step: 1, vertical: false, maximumValueDescription: nil, minimumValueDescription: nil)

Однако я хочу показать текст, когда пользователь меняет значение ползунка.

...